]> git.itanic.dy.fi Git - linux-stable/commitdiff
loop: don't abuse BLK_DEF_MAX_SECTORS
authorChristoph Hellwig <hch@lst.de>
Wed, 27 Dec 2023 09:23:04 +0000 (09:23 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 27 Dec 2023 17:46:01 +0000 (10:46 -0700)
BLK_DEF_MAX_SECTORS despite the confusing name is the default cap for
the max_sectors limits.  Don't use it to initialize max_hw_setors, which
is a hardware / driver capacility.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231227092305.279567-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c

index 23bc8b0fc23cd5bfc6af399f6f9692f6bc7f1411..2bd10f3bfcb296eaadfbe6625ecab687948f2d6c 100644 (file)
@@ -2036,7 +2036,8 @@ static int loop_add(int i)
        }
        lo->lo_queue = lo->lo_disk->queue;
 
-       blk_queue_max_hw_sectors(lo->lo_queue, BLK_DEF_MAX_SECTORS);
+       /* random number picked from the history block max_sectors cap */
+       blk_queue_max_hw_sectors(lo->lo_queue, 2560u);
 
        /*
         * By default, we do buffer IO, so it doesn't make sense to enable