Re: [PATCH v2 2/3] md/raid1,raid10: fix error-path detection with md_cloned_bio()
From: Yu Kuai
Date: Fri May 22 2026 - 00:24:49 EST
Hi,
在 2026/5/21 17:14, Abd-Alrhman Masalkhi 写道:
> The original bio resubmitted via bio_list is not executing in the raid1d
> thread context, so blocking on is_suspended() is correct and will not
> cause a deadlock. The suspension deadlock risk only exists for
> md_cloned_bio executing in the raid1d thread context in the error path.
> And in this case it is always true that if we are executing in the
> raid1d thread context the bio will already be a md_cloned_bio on entry
> to md_handle_request(), even if current->bio_list was set, because (and as
> @Xiao has mentioned) every time we split a bio in the error path we are
> resubmitting the md_cloned_bio remainder, never the original bio.
I do understand this, if original bio or resubmitted bio only split at
raid1_read_request, there is no problem. What I feel is not safe is that
bio can split somewhere else.
This is possible for raid5, However, take a closer look at raid1/10, I
feel it's not possible for resubmitted io to split in bio_split_to_limits.
Even if it happens, it's probably someone else to blame.
--
Thansk,
Kuai