]> git.itanic.dy.fi Git - linux-stable/commit
rbd: set max_segments to USHRT_MAX
authorIlya Dryomov <idryomov@gmail.com>
Thu, 21 Dec 2017 14:35:11 +0000 (15:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jan 2018 08:35:30 +0000 (09:35 +0100)
commitc77dd7b425cdb1a038862b7b092495115e90e6d4
tree68fa5fc727cd8591eaae6cac4f2d0029cbbff69b
parent68829e75666e85aa2191dfbea6d52e91b7acaa89
rbd: set max_segments to USHRT_MAX

commit 21acdf45f4958135940f0b4767185cf911d4b010 upstream.

Commit d3834fefcfe5 ("rbd: bump queue_max_segments") bumped
max_segments (unsigned short) to max_hw_sectors (unsigned int).
max_hw_sectors is set to the number of 512-byte sectors in an object
and overflows unsigned short for 32M (largest possible) objects, making
the block layer resort to handing us single segment (i.e. single page
or even smaller) bios in that case.

Fixes: d3834fefcfe5 ("rbd: bump queue_max_segments")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/rbd.c