Re: [PATCH RFC 1/2] block: rnull: stop zero-filling at the backing page boundary
From: Andreas Hindborg
Date: Mon Nov 30 2026 - 07:15:38 EST
Hi Peder,
"Peder Bergan via B4 Relay" <devnull+peder.bergan.gmail.com@xxxxxxxxxx>
writes:
> From: Peder Bergan <peder.bergan@xxxxxxxxx>
>
> A sector-aligned read can start in an unwritten backing page and
> continue into a resident page within the same bio segment. Filling
> the segment page with zeroes can overwrite the part of the read
> that should have come from the resident page.
>
> Limit zero-filling to the current backing page, then look up the
> next page. Advance the storage position by the sectors copied.
Thanks for the report! This actually identical bug reported (in private)
by Vitaly Wool last week.
I plan to fix this by adding a max length to `Segment::zero_page`. I
think I will also rename the method to `zero_range` or something like
that.
We did extensive testing on bs == PAGE_SIZE and with a fully populated
device. We should add some test vectors for bs != PAGE_SIZE and sparse
populated device.
Best regards,
Andreas Hindborg