diff mbox series

dm zoned: remove duplicated nr_rnd_zones increasement

Message ID 20200322092912.23148-1-bob.liu@oracle.com (mailing list archive)
State New, archived
Headers show
Series dm zoned: remove duplicated nr_rnd_zones increasement | expand

Commit Message

Bob Liu March 22, 2020, 9:29 a.m. UTC
zmd->nr_rnd_zones was increased twice by mistake.
The other place:
1131                 zmd->nr_useable_zones++;
1132                 if (dmz_is_rnd(zone)) {
1133                         zmd->nr_rnd_zones++;
					^^^

Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
 drivers/md/dm-zoned-metadata.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Damien Le Moal March 23, 2020, 2:34 a.m. UTC | #1
On 2020/03/22 18:30, Bob Liu wrote:
> zmd->nr_rnd_zones was increased twice by mistake.
> The other place:
> 1131                 zmd->nr_useable_zones++;
> 1132                 if (dmz_is_rnd(zone)) {
> 1133                         zmd->nr_rnd_zones++;
> 					^^^
> 
> Signed-off-by: Bob Liu <bob.liu@oracle.com>

Good catch ! But you need to add a Fixes tag and CC stable.

    Fixes: 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target")
    Cc: stable@vger.kernel.org

Other than that, looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>

> ---
>  drivers/md/dm-zoned-metadata.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c
> index 516c7b6..369de15 100644
> --- a/drivers/md/dm-zoned-metadata.c
> +++ b/drivers/md/dm-zoned-metadata.c
> @@ -1109,7 +1109,6 @@ static int dmz_init_zone(struct blk_zone *blkz, unsigned int idx, void *data)
>  	switch (blkz->type) {
>  	case BLK_ZONE_TYPE_CONVENTIONAL:
>  		set_bit(DMZ_RND, &zone->flags);
> -		zmd->nr_rnd_zones++;
>  		break;
>  	case BLK_ZONE_TYPE_SEQWRITE_REQ:
>  	case BLK_ZONE_TYPE_SEQWRITE_PREF:
>
diff mbox series

Patch

diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c
index 516c7b6..369de15 100644
--- a/drivers/md/dm-zoned-metadata.c
+++ b/drivers/md/dm-zoned-metadata.c
@@ -1109,7 +1109,6 @@  static int dmz_init_zone(struct blk_zone *blkz, unsigned int idx, void *data)
 	switch (blkz->type) {
 	case BLK_ZONE_TYPE_CONVENTIONAL:
 		set_bit(DMZ_RND, &zone->flags);
-		zmd->nr_rnd_zones++;
 		break;
 	case BLK_ZONE_TYPE_SEQWRITE_REQ:
 	case BLK_ZONE_TYPE_SEQWRITE_PREF: