Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Nigel Croxon <ncroxon@redhat.com>
To: song@kernel.org, yukuai@fnnas.com, linux-raid@vger.kernel.org
Subject: [PATCH] md/raid5: Fix bio retry on interrupted reshape
Date: Wed, 29 Apr 2026 07:10:59 -0400	[thread overview]
Message-ID: <f861791b-d539-45ce-8575-5ec74d58d15d@redhat.com> (raw)

When a bio encounters LOC_INSIDE_RESHAPE during a reshape that is
interrupted (stopped or unable to progress), the code sets
bi->bi_status = BLK_STS_RESOURCE to signal the block layer for retry.
However, bio_endio() is never called, so the block layer never
receives the completion notification and the retry never happens.

This causes I/O to hang when a filesystem is layered over RAID5 and
reshape gets stuck.

Fix this by calling bio_endio(bi) before md_free_cloned_bio(bi) so
the block layer is properly notified of the BLK_STS_RESOURCE status
and can retry the request.

Tested stripes and stripe size conversions under load comparing
files multiple times during each conversion (i.e. MD reshape) on
ext4 after dropping caches degrading the RaidLV each time and
no data corruption.

Fixes: https://lwn.net/Articles/757123/

Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
---
  drivers/md/raid5.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 6e79829c5acb..9a3475429ef4 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -6217,6 +6217,7 @@ static bool raid5_make_request(struct mddev 
*mddev, struct bio * bi)

      mempool_free(ctx, conf->ctx_pool);
      if (res == STRIPE_WAIT_RESHAPE) {
+        bio_endio(bi);
          md_free_cloned_bio(bi);
          return false;
      }
-- 
2.47.3


             reply	other threads:[~2026-04-29 11:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 11:10 Nigel Croxon [this message]
2026-04-29 13:07 ` [PATCH] md/raid5: Fix bio retry on interrupted reshape Paul Menzel
2026-04-30 11:53   ` Nigel Croxon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f861791b-d539-45ce-8575-5ec74d58d15d@redhat.com \
    --to=ncroxon@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=yukuai@fnnas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox