Linux block layer
 help / color / mirror / Atom feed
* [PATCH v2 0/2] block: Fix __blkdev_issue_write_zeroes() limit handling
@ 2024-08-15 16:32 John Garry
  2024-08-15 16:32 ` [PATCH v2 1/2] block: Read max write zeroes once for __blkdev_issue_write_zeroes() John Garry
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: John Garry @ 2024-08-15 16:32 UTC (permalink / raw)
  To: axboe, hch; +Cc: martin.petersen, linux-block, kbusch, John Garry

As reported in [0], we may get an infinite loop in
__blkdev_issue_write_zeroes() for making an XFS FS on a raid0 config.

Fix __blkdev_issue_write_zeroes() limit handling by reading the write
zeroes limit outside the loop.

Also include a change to drop the unnecessary NULL queue check in
bdev_write_zeroes_sectors().

[0] https://lore.kernel.org/linux-block/20240815062112.GA14067@lst.de/T/#m14ed5d882f9390a46cfe2fcfa2b51218aafbd32e

Differences to v1:
- Add RB tags from Christoph (thanks!)
- Update comment on __blkdev_issue_write_zeroes (Martin, Christoph)

John Garry (2):
  block: Read max write zeroes once for __blkdev_issue_write_zeroes()
  block: Drop NULL check in bdev_write_zeroes_sectors()

 block/blk-lib.c        | 25 ++++++++++++++++++-------
 include/linux/blkdev.h |  7 +------
 2 files changed, 19 insertions(+), 13 deletions(-)

-- 
2.31.1


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

end of thread, other threads:[~2024-08-28  7:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15 16:32 [PATCH v2 0/2] block: Fix __blkdev_issue_write_zeroes() limit handling John Garry
2024-08-15 16:32 ` [PATCH v2 1/2] block: Read max write zeroes once for __blkdev_issue_write_zeroes() John Garry
2024-08-15 17:43   ` Martin K. Petersen
2024-08-16 18:34   ` Nitesh Shetty
2024-08-17 15:33     ` John Garry
2024-08-19 15:15       ` Nitesh Shetty
2024-08-28  7:15   ` Shinichiro Kawasaki
2024-08-28  7:17     ` hch
2024-08-28  7:25       ` Shinichiro Kawasaki
2024-08-15 16:32 ` [PATCH v2 2/2] block: Drop NULL check in bdev_write_zeroes_sectors() John Garry
2024-08-15 17:43   ` Martin K. Petersen
2024-08-19 15:16   ` Nitesh Shetty
2024-08-19 15:49 ` [PATCH v2 0/2] block: Fix __blkdev_issue_write_zeroes() limit handling Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox