Re: [PATCH RFC 2/2] block: rnull: track uncached discard coverage by sector

From: Andreas Hindborg

Date: Mon Nov 30 2026 - 07:15:44 EST


"Peder Bergan via B4 Relay" <devnull+peder.bergan.gmail.com@xxxxxxxxxx>
writes:

> From: Peder Bergan <peder.bergan@xxxxxxxxx>
>
> A configfs device can retain its backing storage when it is
> powered off and brought back with a different logical block
> size. Block-based occupancy cannot then describe which sectors
> a discard covers. A partial discard can drop a page with data
> outside the requested range, or leave a fully discarded page
> allocated.

The semantics of changing block size between power cycles is not well
documented. The rnull driver intentionally mirrors the implementation in
C null_blk. I think you should establish the semantics you want over
there first and then we can match them in rnull if they change.

I think we should either refuse to change the block size between power
cycles of the virtual device, or just accept the current limitations, but
document them better.

Best regards,
Andreas Hindborg