block: fix bio splitting on max sectors
authorMing Lei <tom.leiming@gmail.com>
Sat, 23 Jan 2016 00:05:33 +0000 (08:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Feb 2016 20:30:56 +0000 (12:30 -0800)
commitbfc5caf7569e39999c6515bd9f945bde14f2990f
tree2d82591e11dc3c763a1cd8c0f4151f9af24497da
parent9e5d4a6c799565346b677484f7348effd6f2d877
block: fix bio splitting on max sectors

commit d0e5fbb01a67e400e82fefe4896ea40c6447ab98 upstream.

After commit e36f62042880(block: split bios to maxpossible length),
bio can be splitted in the middle of a vector entry, then it
is easy to split out one bio which size isn't aligned with block
size, especially when the block size is bigger than 512.

This patch fixes the issue by making the max io size aligned
to logical block size.

Fixes: e36f62042880(block: split bios to maxpossible length)
Reported-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Cc: Keith Busch <keith.busch@intel.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-merge.c