This is a note to let you know that I've just added the patch titled block: make sure writesame bio is aligned with logical block size to the 4.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: block-make-sure-writesame-bio-is-aligned-with-logical-block-size.patch and it can be found in the queue-4.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 34ffec60b27aa81d04e274e71e4c6ef740f75fc7 Mon Sep 17 00:00:00 2001 From: Ming Lei <ming.lei@xxxxxxxxxx> Date: Mon, 29 Oct 2018 20:57:19 +0800 Subject: block: make sure writesame bio is aligned with logical block size From: Ming Lei <ming.lei@xxxxxxxxxx> commit 34ffec60b27aa81d04e274e71e4c6ef740f75fc7 upstream. 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@xxxxxxxxxxxxxxx Cc: Mike Snitzer <snitzer@xxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Xiao Ni <xni@xxxxxxxxxx> Cc: Mariusz Dabrowski <mariusz.dabrowski@xxxxxxxxx> Fixes: b49a0871be31a745b2ef ("block: remove split code in blkdev_issue_{discard,write_same}") Tested-by: Rui Salvaterra <rsalvaterra@xxxxxxxxx> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- block/blk-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -161,7 +161,7 @@ static int __blkdev_issue_write_same(str return -EOPNOTSUPP; /* Ensure that max_write_same_sectors doesn't overflow bi_size */ - max_write_same_sectors = UINT_MAX >> 9; + max_write_same_sectors = bio_allowed_max_sectors(q); while (nr_sects) { bio = next_bio(bio, 1, gfp_mask); Patches currently in stable-queue which might be from ming.lei@xxxxxxxxxx are queue-4.18/block-make-sure-discard-bio-is-aligned-with-logical-block-size.patch queue-4.18/block-make-sure-writesame-bio-is-aligned-with-logical-block-size.patch queue-4.18/block-don-t-deal-with-discard-limit-in-blkdev_issue_discard.patch