public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yu Kuai" <yukuai@fnnas.com>
To: <song@kernel.org>, <linux-raid@vger.kernel.org>
Cc: <linan122@huawei.com>, <linux-kernel@vger.kernel.org>,
	 <yukuai@fnnas.com>
Subject: Re: [PATCH] md: wake raid456 reshape waiters before suspend
Date: Tue, 7 Apr 2026 13:32:04 +0800	[thread overview]
Message-ID: <c84c3acd-1c9c-442d-ab17-022b5f3590a3@fnnas.com> (raw)
In-Reply-To: <20260327140729.2030564-1-yukuai@fnnas.com>

在 2026/3/27 22:07, Yu Kuai 写道:

> During raid456 reshape, direct IO across the reshape position can sleep
> in raid5_make_request() waiting for reshape progress while still
> holding an active_io reference. If userspace then freezes reshape and
> writes md/suspend_lo or md/suspend_hi, mddev_suspend() kills active_io
> and waits for all in-flight IO to drain.
>
> This can deadlock: the IO needs reshape progress to continue, but the
> reshape thread is already frozen, so the active_io reference is never
> dropped and suspend never completes.
>
> raid5_prepare_suspend() already wakes wait_for_reshape for dm-raid. Do
> the same for normal md suspend when reshape is already interrupted, so
> waiting raid456 IO can abort, drop its reference, and let suspend
> finish.
>
> The mdadm test tests/25raid456-reshape-deadlock reproduces the hang.
>
> Fixes: 714d20150ed8 ("md: add new helpers to suspend/resume array")
> Signed-off-by: Yu Kuai<yukuai@fnnas.com>
> ---
>   drivers/md/md.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
Applied to md-7.1

-- 
Thansk,
Kuai

      parent reply	other threads:[~2026-04-07  5:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27 14:07 [PATCH] md: wake raid456 reshape waiters before suspend Yu Kuai
2026-04-02  2:53 ` Li Nan
2026-04-07  5:33   ` Yu Kuai
2026-04-07  5:32 ` Yu Kuai [this message]

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=c84c3acd-1c9c-442d-ab17-022b5f3590a3@fnnas.com \
    --to=yukuai@fnnas.com \
    --cc=linan122@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    /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