Re: [PATCH v3 07/13] block: drop all zone write plugs on capacity changes

Hannes Reinecke <[email protected]>
Newsgroups org.kernel.vger.linux-block
Message-ID <[email protected]>
On 8/11/26 12:58 PM, Damien Le Moal wrote:
> If during revalidation, we detect a capacity change for a zoned block
> device, e.g. due to a storage element removal on an HDD, we can assume
> that the device was reformatted, which implies that all sequential zones
> are empty. For such case, we can remove and free all zone write plugs in
> the gendisk hash table by marking them as dead, thus avoiding also to
> leave zone write plugs for zones that are beyond the new device capacity
> in the disk hash table.
> 
> Introduce the function disk_revalidate_capacity() to do this and call this
> new function at the beginning of blk_revalidate_disk_zones(), so that the
> zone revalidation process can re-create, if needed, any zone write plug
> for sequential zones that are not empty.
> 
> The checks on the capacity and zone size that were in
> blk_revalidate_disk_zones() are moved to disk_revalidate_capacity() and
> if true, also trigger dropping all zone write plugs.
> 
> Signed-off-by: Damien Le Moal <[email protected]>
> Reviewed-by: Bart Van Assche <[email protected]>
> ---
>   block/blk-zoned.c | 81 ++++++++++++++++++++++++++++++++++++-----------
>   1 file changed, 63 insertions(+), 18 deletions(-)
> 
Reviewed-by: Hannes Reinecke <[email protected]>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.