block: make sure writesame bio is aligned with logical block size
authorMing Lei <ming.lei@redhat.com>
Mon, 29 Oct 2018 12:57:19 +0000 (20:57 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 9 Nov 2018 13:23:18 +0000 (06:23 -0700)
commit34ffec60b27aa81d04e274e71e4c6ef740f75fc7
tree242e7545cc12a3db2cba1831e21280955808c5b8
parentba5d73851e71847ba7f7f4c27a1a6e1f5ab91c79
block: make sure writesame bio is aligned with logical block size

Obviously the created writesame bio has to be aligned with logical block
size, and use bio_allowed_max_sectors() to retrieve this number.

Cc: stable@vger.kernel.org
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Xiao Ni <xni@redhat.com>
Cc: Mariusz Dabrowski <mariusz.dabrowski@intel.com>
Fixes: b49a0871be31a745b2ef ("block: remove split code in blkdev_issue_{discard,write_same}")
Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-lib.c