Skip to contentSkip to conversation

Patch "rbd: set max_segments to USHRT_MAX" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Jan 13, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

rbd: set max_segments to USHRT_MAX

to the 4.4-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:
rbd-set-max_segments-to-ushrt_max.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 21acdf45f4958135940f0b4767185cf911d4b010 Mon Sep 17 00:00:00 2001

From: Ilya Dryomov <[email protected]>
Date: Thu, 21 Dec 2017 15:35:11 +0100
Subject: rbd: set max_segments to USHRT_MAX

From: Ilya Dryomov <[email protected]>

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")
---
 drivers/block/rbd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/rbd.c +1 -1
@@ -3767,7 +3767,7 @@ static int rbd_init_disk(struct rbd_devi
 	segment_size = rbd_obj_bytes(&rbd_dev->header);
 	blk_queue_max_hw_sectors(q, segment_size / SECTOR_SIZE);
 	q->limits.max_sectors = queue_max_hw_sectors(q);
-	blk_queue_max_segments(q, segment_size / SECTOR_SIZE);
+	blk_queue_max_segments(q, USHRT_MAX);
 	blk_queue_max_segment_size(q, segment_size);
 	blk_queue_io_min(q, segment_size);
 	blk_queue_io_opt(q, segment_size);

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/rbd-set-max_segments-to-ushrt_max.patch