On 2020/05/13 16:07, Hannes Reinecke wrote: > 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 <h...@suse.de> > --- > 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.
Nit: the comment would be better as: /* Only sequential zones need reset */ > + */ > + 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)) { > Otherwise, looks good. Reviewed-by: Damien Le Moal <damien.lem...@wdc.com> -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel