mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yu Kuai" <yukuai@fnnas.com>
To: "Abd-Alrhman Masalkhi" <abd.masalkhi@gmail.com>,
	<song@kernel.org>,  <xni@redhat.com>, <neilb@suse.com>,
	<shli@fb.com>
Cc: <linux-raid@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	 <yukuai@fygo.io>
Subject: Re: [PATCH v2 1/3] md/raid1,raid10: fix deadlock in read error recovery path
Date: Thu, 21 May 2026 09:28:14 +0800	[thread overview]
Message-ID: <80f129b1-908b-401c-9dee-c85822b6b700@fygo.io> (raw)
In-Reply-To: <20260501114652.590037-2-abd.masalkhi@gmail.com>

在 2026/5/1 19:46, Abd-Alrhman Masalkhi 写道:

> raid1d and raid10d may resubmit a split md cloned bio while handling
> a read error. In this case, resubmitting the bio can lead to a deadlock
> if the array is suspended before md_handle_request() acquires an
> active_io reference via percpu_ref_tryget_live().
>
> Since the cloned bio already holds an active_io reference,
> trying to acquire another reference via percpu_ref_tryget_live()
> can lead to a deadlock while the array is suspended.
>
> Fix this by using percpu_ref_get() for md cloned bios.
>
> Fixes: bb2a9acefaf9 ("md/raid1: switch to use md_account_bio() for io accounting")
> Fixes: 820455238366 ("md/raid10: switch to use md_account_bio() for io accounting")
> Signed-off-by: Abd-Alrhman Masalkhi<abd.masalkhi@gmail.com>
> ---
> Changes in v2:
>   - Use md_cloned_bio() consistently to detect cloned bios.
>   - Recognize that raid10 has the same issue and fix it in this series	
>   - Allow splitting bios.
>   - Handle md cloned bios explicitly in md_handle_request()
>   - Link v1:https://lore.kernel.org/linux-raid/20260427103446.300378-1-abd.masalkhi@gmail.com/
>
> Please let me know if I should add a Suggested-by tag for Yu Kuai,
> as the solution approach was suggested during review.
>
> Link to Yu Kuai' email:https://lore.kernel.org/linux-raid/m2lde74dtw.fsf@gmail.com/T/#m714020a38b60fc5f84b9a24f0c46acbe5d7342d6
>
> Thanks
> Abd-alrhman
> ---
>   drivers/md/md.c | 25 ++++++++++++++++---------
>   drivers/md/md.h |  5 +++++
>   2 files changed, 21 insertions(+), 9 deletions(-)

Reviewed-by: Yu Kuai <yukuai@fygo.io>

-- 
Thansk,
Kuai

  parent reply	other threads:[~2026-05-21  1:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 11:46 [PATCH v2 0/3] md/raid1,raid10: fix deadlock and bio accounting in read error path Abd-Alrhman Masalkhi
2026-05-01 11:46 ` [PATCH v2 1/3] md/raid1,raid10: fix deadlock in read error recovery path Abd-Alrhman Masalkhi
2026-05-19  7:46   ` Xiao Ni
2026-05-21  1:28   ` Yu Kuai [this message]
2026-05-01 11:46 ` [PATCH v2 2/3] md/raid1,raid10: fix error-path detection with md_cloned_bio() Abd-Alrhman Masalkhi
2026-05-19  8:11   ` Xiao Ni
2026-05-21  1:24   ` Yu Kuai
2026-05-21  7:08     ` Xiao Ni
2026-05-21  7:29       ` Yu Kuai
2026-05-21  9:14         ` Abd-Alrhman Masalkhi
2026-05-22  4:23           ` Yu Kuai
2026-05-22 11:02             ` Abd-Alrhman Masalkhi
2026-05-01 11:46 ` [PATCH v2 3/3] md/raid1,raid10: fix bio accounting for split md cloned bios Abd-Alrhman Masalkhi
2026-05-19  8:18   ` Xiao Ni
2026-05-21  1:26   ` Yu Kuai
2026-05-22  5:23 ` [PATCH v2 0/3] md/raid1,raid10: fix deadlock and bio accounting in read error path Yu Kuai

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=80f129b1-908b-401c-9dee-c85822b6b700@fygo.io \
    --to=yukuai@fnnas.com \
    --cc=abd.masalkhi@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.com \
    --cc=shli@fb.com \
    --cc=song@kernel.org \
    --cc=xni@redhat.com \
    --cc=yukuai@fygo.io \
    /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

all inboxes | Powered by JetHome®