]> git.ipfire.org Git - thirdparty/linux.git/commit - include/linux/blkdev.h
block: save user max_sectors limit
authorKeith Busch <kbusch@kernel.org>
Thu, 5 Jan 2023 20:51:46 +0000 (12:51 -0800)
committerJens Axboe <axboe@kernel.dk>
Sun, 29 Jan 2023 22:18:33 +0000 (15:18 -0700)
commitc9c77418a98273fe96835c42666f7427b3883f48
treeab45a1f2d1e3491b68a6baf62661e7ca4f2f68a8
parent0a26f327e46c203229e72c823dfec71a2b405ec5
block: save user max_sectors limit

The user can set the max_sectors limit to any valid value via sysfs
/sys/block/<dev>/queue/max_sectors_kb attribute. If the device limits
are ever rescanned, though, the limit reverts back to the potentially
artificially low BLK_DEF_MAX_SECTORS value.

Preserve the user's setting as the max_sectors limit as long as it's
valid. The user can reset back to defaults by writing 0 to the sysfs
file.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20230105205146.3610282-3-kbusch@meta.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Documentation/ABI/stable/sysfs-block
block/blk-settings.c
block/blk-sysfs.c
include/linux/blkdev.h