Re: [PATCH v4 4/7] md/raid10: remove unnecessary barrier around bio_submit_split_bioset()

From: yu kuai

Date: Thu Jul 16 2026 - 05:25:37 EST


在 2026/7/10 18:15, Abd-Alrhman Masalkhi 写道:

> raid10_write_request() drops the barrier before calling
> bio_submit_split_bioset() and reacquires it afterwards. This is no
> longer necessary because the split bio cannot re-enter
> raid10_write_request() while the barrier is held.
>
> The allow_barrier()/wait_barrier() pair was introduced by commit
> e820d55cb99d ("md: fix raid10 hang issue caused by barrier") when
> submit_flushes() called md_handle_request() directly, allowing re-entry
> into raid10_write_request(). Since v5.2, submit_flushes() has instead
> gone through submit_bio(), eliminating that recursion. submit_flushes()
> was later removed entirely by commit b75197e86e6d ("md: Remove flush
> handling").
>
> Currently, raid10_write_request() is only entered from the bio
> submission path, so the split bio submitted by bio_submit_split_bioset()
> cannot recurse back into wait_barrier().
>
> Remove the redundant allow_barrier()/wait_barrier() pair around
> bio_submit_split_bioset().
>
> Signed-off-by: Abd-Alrhman Masalkhi<abd.masalkhi@xxxxxxxxx>
> ---
> Changes in v4:
> - No changes.
> - Link to v3:https://lore.kernel.org/linux-raid/20260708101341.473750-5-abd.masalkhi@xxxxxxxxx/
>
> Changes in v3:
> - No changes.
> - Link to v2:https://lore.kernel.org/linux-raid/20260628142420.1051027-5-abd.masalkhi@xxxxxxxxx/
>
> Changes in v2:
> - Expand the commit message to explain why the
> allow_barrier()/wait_barrier() pair is no longer needed.
> - Link to v1:https://lore.kernel.org/linux-raid/20260623072456.333437-5-abd.masalkhi@xxxxxxxxx/
> ---
> drivers/md/raid10.c | 2 --
> 1 file changed, 2 deletions(-)
Reviewed-by: Yu Kuai <yukuai@xxxxxxx>

--
Thanks,
Kuai