Browse files

block: Allow changing max_sectors_kb above the default 512

The patch "block: Use accessor functions for queue limits"
(ae03bf6) changed queue_max_sectors_store()
to use blk_queue_max_sectors() instead of directly assigning the value.

But blk_queue_max_sectors() differs a bit
1. It sets both max_sectors_kb, and max_hw_sectors_kb
2. Never allows one to change max_sectors_kb above BLK_DEF_MAX_SECTORS. If one
specifies a value greater then max_hw_sectors is set to that value but
max_sectors is set to BLK_DEF_MAX_SECTORS

I am not sure whether blk_queue_max_sectors() should be changed, as it seems
to be that way for a long time. And there may be callers dependent on that

This patch simply reverts to the older way of directly assigning the value to
max_sectors as it was before.

Signed-off-by: Nikanth Karthikesan <>
Signed-off-by: Jens Axboe <>
  • Loading branch information...
1 parent adda766 commit c295fc05789653ef24f296299df7c5f92fe74dce Nikanth Karthikesan committed with Jens Axboe Sep 1, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 block/blk-sysfs.c
@@ -133,7 +133,7 @@ queue_max_sectors_store(struct request_queue *q, const char *page, size_t count)
return -EINVAL;
- blk_queue_max_sectors(q, max_sectors_kb << 1);
+ q->limits.max_sectors = max_sectors_kb << 1;
return ret;

0 comments on commit c295fc0

Please sign in to comment.