Re: [PATCH v4 3/7] md/raid10: consistently fail atomic writes that require splitting
From: Abd-Alrhman Masalkhi
Date: Wed Jul 15 2026 - 06:05:52 EST
On Wed, Jul 15, 2026 at 10:25 +0100, John Garry wrote:
> On 10/07/2026 11:15, Abd-Alrhman Masalkhi wrote:
>> RAID10 currently handles one badblock path explicitly by failing atomic
>> writes with EIO. However, another badblock path can also reduce the
>> writable range and force the bio through bio_submit_split_bioset(),
>
> What is this other badblock path which you are referring to?
>
The other path is when the requested write overlaps a bad-block region
from the beginning, but the intended write extends beyond the bad-block
region. In that case, the current code silently reduces max_sectors.
As a result, we end up calling bio_submit_split_bioset(), which
completes the bio with -EINVAL rather than -EIO. This is the same issue
that existed in raid1 and was fixed by patch 2.
>> which implicitly completes the bio with EINVAL.
>>
>> Fix this by handling atomic writes in the common split check. If RAID10
>> determines that an atomic write would require splitting, complete the
>> bio with EIO.
>>
>> Fixes: a1d9b4fd42d9 ("md/raid10: Atomic write support")
>> Signed-off-by: Abd-Alrhman Masalkhi<abd.masalkhi@xxxxxxxxx>
>> ---
>
--
Best Regards,
Abd-Alrhman