[PATCH 01/23] block: don't reject too large max_user_setors in blk_validate_limits

6 views
Skip to first unread message

Christoph Hellwig

unread,
Mar 24, 2024, 7:55:27 PMMar 24
to Jens Axboe, Martin K. Petersen, Damien Le Moal, Niklas Cassel, Takashi Sakamoto, Sathya Prakash, Sreekanth Reddy, Suganath Prabu Subramani, Juergen E. Fischer, Xiang Chen, HighPoint Linux Team, Tyrel Datwyler, Brian King, Lee Duncan, Chris Leech, Mike Christie, John Garry, Jason Yan, Kashyap Desai, Sumit Saxena, Shivasharan S, Chandrakanth patil, Jack Wang, Nilesh Javali, GR-QLogic-Sto...@marvell.com, Greg Kroah-Hartman, Alim Akhtar, Avri Altman, Bart Van Assche, Krzysztof Kozlowski, Alan Stern, linux...@vger.kernel.org, linu...@vger.kernel.org, linux13...@lists.sourceforge.net, MPT-Fusio...@broadcom.com, linux...@vger.kernel.org, open-...@googlegroups.com, megaraid...@broadcom.com, mpi3mr-li...@broadcom.com, linux-sa...@vger.kernel.org, linu...@vger.kernel.org, usb-s...@lists.one-eyed-alien.net
We already cap down the actual max_sectors to the max of the hardware
and user limit, so don't reject the configuration.

Signed-off-by: Christoph Hellwig <h...@lst.de>
---
block/blk-settings.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index 3c7d8d638ab59d..cdbaef159c4bc3 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -146,8 +146,7 @@ static int blk_validate_limits(struct queue_limits *lim)
max_hw_sectors = min_not_zero(lim->max_hw_sectors,
lim->max_dev_sectors);
if (lim->max_user_sectors) {
- if (lim->max_user_sectors > max_hw_sectors ||
- lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE)
+ if (lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE)
return -EINVAL;
lim->max_sectors = min(max_hw_sectors, lim->max_user_sectors);
} else {
--
2.39.2

Damien Le Moal

unread,
Mar 25, 2024, 3:15:04 AMMar 25
to Christoph Hellwig, Jens Axboe, Martin K. Petersen, Niklas Cassel, Takashi Sakamoto, Sathya Prakash, Sreekanth Reddy, Suganath Prabu Subramani, Juergen E. Fischer, Xiang Chen, HighPoint Linux Team, Tyrel Datwyler, Brian King, Lee Duncan, Chris Leech, Mike Christie, John Garry, Jason Yan, Kashyap Desai, Sumit Saxena, Shivasharan S, Chandrakanth patil, Jack Wang, Nilesh Javali, GR-QLogic-Sto...@marvell.com, Greg Kroah-Hartman, Alim Akhtar, Avri Altman, Bart Van Assche, Krzysztof Kozlowski, Alan Stern, linux...@vger.kernel.org, linu...@vger.kernel.org, linux13...@lists.sourceforge.net, MPT-Fusio...@broadcom.com, linux...@vger.kernel.org, open-...@googlegroups.com, megaraid...@broadcom.com, mpi3mr-li...@broadcom.com, linux-sa...@vger.kernel.org, linu...@vger.kernel.org, usb-s...@lists.one-eyed-alien.net
On 3/25/24 08:54, Christoph Hellwig wrote:
> We already cap down the actual max_sectors to the max of the hardware
> and user limit, so don't reject the configuration.
>
> Signed-off-by: Christoph Hellwig <h...@lst.de>

Looks OK to me.

Reviewed-by: Damien Le Moal <dle...@kernel.org>

--
Damien Le Moal
Western Digital Research

Reply all
Reply to author
Forward
0 new messages