Re: [PATCH v2 07/13] block: drop all zone write plugs on capacity changes
Hannes Reinecke <[email protected]> Fri, 7 Aug 2026 12:24:30 +0200
| Newsgroups | org.kernel.vger.linux-block |
|---|---|
| Message-ID | <[email protected]> |
On 8/6/26 6:04 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]> > --- > block/blk-zoned.c | 71 ++++++++++++++++++++++++++++++++++++----------- > 1 file changed, 55 insertions(+), 16 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