linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Validate logical block size in blk_validate_limits()
@ 2024-07-08  9:16 John Garry
  2024-07-08  9:16 ` [PATCH v2 1/5] virtio_blk: Fix default logical block size fallback John Garry
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: John Garry @ 2024-07-08  9:16 UTC (permalink / raw)
  To: axboe, mst, jasowang, xuanzhuo, eperezma, pbonzini, stefanha,
	hare, kbusch, hch
  Cc: linux-block, linux-kernel, virtualization, John Garry

This series adds validation of the logical block size in
blk_validate_limits().

Some drivers had already been validating this themselves. As such, we can
mostly drop that driver validation.

nbd is problematic, as we cannot only change to just stop calling
blk_validate_limits(). This is because the LBS is updated in a 2-stage
process:
a. update block size in the driver and validate
b. update queue limits

So if we stop validating the limits in a., there is a user-visible change
in behaviour (as we stop rejecting invalid limits from the NBD_SET_BLKSIZE
ioctl). So I left that untouched.

This topic was originally mentioned in [0] and then again in [1] by
Keith.

I have also included a related virtio_blk change to deal with
blk_size config fallback.

[0] https://lore.kernel.org/linux-block/10b3e3fe-6ad5-4e0e-b822-f51656c976ee@oracle.com/
[1] https://lore.kernel.org/linux-block/Zl4dxaQgPbw19Irk@kbusch-mbp.dhcp.thefacebook.com/

Differences to v1:
- Add RB tags (thanks!)
- Update comment on blk_validate_block_size() and add print in
  blk_validate_limits()

John Garry (5):
  virtio_blk: Fix default logical block size fallback
  block: Validate logical block size in blk_validate_limits()
  null_blk: Don't bother validating blocksize
  virtio_blk: Don't bother validating blocksize
  loop: Don't bother validating blocksize

 block/blk-settings.c          |  4 ++++
 drivers/block/loop.c          | 12 +-----------
 drivers/block/null_blk/main.c |  3 ---
 drivers/block/virtio_blk.c    | 31 +++++++++++--------------------
 include/linux/blkdev.h        |  1 +
 5 files changed, 17 insertions(+), 34 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-07-09  6:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-08  9:16 [PATCH v2 0/5] Validate logical block size in blk_validate_limits() John Garry
2024-07-08  9:16 ` [PATCH v2 1/5] virtio_blk: Fix default logical block size fallback John Garry
2024-07-08  9:16 ` [PATCH v2 2/5] block: Validate logical block size in blk_validate_limits() John Garry
2024-07-09  5:38   ` Damien Le Moal
2024-07-08  9:16 ` [PATCH v2 3/5] null_blk: Don't bother validating blocksize John Garry
2024-07-09  0:12   ` Zhu Yanjun
2024-07-09  5:39   ` Damien Le Moal
2024-07-08  9:16 ` [PATCH v2 4/5] virtio_blk: " John Garry
2024-07-09  5:39   ` Damien Le Moal
2024-07-08  9:16 ` [PATCH v2 5/5] loop: " John Garry
2024-07-09  5:39   ` Damien Le Moal
2024-07-09  6:01 ` [PATCH v2 0/5] Validate logical block size in blk_validate_limits() Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).