[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d4f02398-977f-47ef-9868-d3b08313c126@oracle.com>
Date: Fri, 5 Jul 2024 13:34:37 +0100
From: John Garry <john.g.garry@...cle.com>
To: Christoph Hellwig <hch@....de>
Cc: axboe@...nel.dk, mst@...hat.com, jasowang@...hat.com,
xuanzhuo@...ux.alibaba.com, eperezma@...hat.com, pbonzini@...hat.com,
stefanha@...hat.com, hare@...e.de, kbusch@...nel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
virtualization@...ts.linux.dev
Subject: Re: [PATCH 2/5] block: Validate logical block size in
blk_validate_limits()
On 05/07/2024 13:16, Christoph Hellwig wrote:
>> if (!lim->logical_block_size)
>> lim->logical_block_size = SECTOR_SIZE;
>> + else if (blk_validate_block_size(lim->logical_block_size))
>> + return -EINVAL;
>
> This should print a message. Unfortunately we don't have the device
> name here (for that we'd need to set it at disk/queue allocation time,
> which will require a bit of work), but even without that it will be
> very useful.
Ok, I can print a message, like:
pr_warn("Invalid logical block size (%d)\n", bsize);
I am wary though that userspace could trigger this message from the
various ioctls to set the bsize.
>
>> +/* blk_validate_limits() validates bsize, so drivers don't need to */
>
> maybe throw in a usually or normally?
>
fine
Powered by blists - more mailing lists