public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] md/raid1: possible deadlock introduced in raid1_read_request()
@ 2026-04-25 14:29 Abd-Alrhman Masalkhi
  0 siblings, 0 replies; only message in thread
From: Abd-Alrhman Masalkhi @ 2026-04-25 14:29 UTC (permalink / raw)
  To: song, yukuai; +Cc: linux-raid, linux-kernel

hi,

The raid1_read_request() function splits a bio regardless of whether it
is an original bio or an md-cloned bio (regardless of the r1bio_existed
value).

When an md_cloned_bio is resubmitted, raid1_read_request() treats it as a
new original bio instead of recognizing it as an md_cloned_bio.

If I understand this correctly, this results in allocating a new r1bio,
etc. More importantly, this may lead to a deadlock if we tried to 
suspended the array before the md driver calls percpu_ref_tryget_live()
(&mddev->active_io) on the path down to pers->make_request().

I am considering two possible approaches, ending the bio if max_sectors
is smaller than bio_sectors(bio), or modifing read_balance() to select
a disk that can handle the full bio if r1bio_existed was set.

Is this understanding correct? and What might be the preferred approach
in this case?

Thanks,
Abd-Alrhman

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-25 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-25 14:29 [RFC] md/raid1: possible deadlock introduced in raid1_read_request() Abd-Alrhman Masalkhi

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