diff mbox series

[08/10] md: switch to using blk_next_discard_bio directly

Message ID 20240307151157.466013-9-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [01/10] block: remove the discard_granularity check in __blkdev_issue_discard | expand

Commit Message

Christoph Hellwig March 7, 2024, 3:11 p.m. UTC
This fixes fatal signals getting into the way and corrupting the bio
chain and removes the need to handle synchronous errors.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/md.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7d7b982e369c11..5803a298dd40f9 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8722,8 +8722,10 @@  void md_submit_discard_bio(struct mddev *mddev, struct md_rdev *rdev,
 {
 	struct bio *discard_bio = NULL;
 
-	if (__blkdev_issue_discard(rdev->bdev, start, size, GFP_NOIO,
-			&discard_bio) || !discard_bio)
+	while (blk_next_discard_bio(rdev->bdev, &discard_bio, &start, &size,
+			GFP_NOIO))
+		;
+	if (!discard_bio)
 		return;
 
 	bio_chain(discard_bio, bio);