Instead of excluding invalid zones we should check if the zone is sequential and exclude invalid states. That way we don't need to touch the selection when new zone states or flags are added. Signed-off-by: Hannes Reinecke <hare@xxxxxxx> --- drivers/md/dm-zoned-metadata.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index d9e256762eff..9b93d7ff1dfc 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -1570,12 +1570,16 @@ static int dmz_reset_zone(struct dmz_metadata *zmd, struct dm_zone *zone) int ret; /* - * Ignore offline zones, read only zones, - * and conventional zones. + * Only check sequential zones. + */ + if (!dmz_is_seq(zone)) + return 0; + + /* + * But ignore offline and read only zones. */ if (dmz_is_offline(zone) || - dmz_is_readonly(zone) || - dmz_is_rnd(zone)) + dmz_is_readonly(zone)) return 0; if (!dmz_is_empty(zone) || dmz_seq_write_err(zone)) { -- 2.25.0 -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel