Skip to contentSkip to conversation

FAILED: patch "[PATCH] dm zoned: remove duplicate nr_rnd_zones increase in" failed to apply to 5.4-stable tree

PATCH [email protected] 3 participants 3 messages Apr 15, 2020 – Apr 16, 2020

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From b8fdd090376a7a46d17db316638fe54b965c2fb0 Mon Sep 17 00:00:00 2001
From: Bob Liu <[email protected]>
Date: Tue, 24 Mar 2020 21:22:45 +0800
Subject: [PATCH] dm zoned: remove duplicate nr_rnd_zones increase in
dmz_init_zone()

zmd->nr_rnd_zones was increased twice by mistake. The other place it is increased in dmz_init_zone() is the only one needed:

1131 zmd->nr_useable_zones++;
1132 if (dmz_is_rnd(zone)) {

1133                         zmd->nr_rnd_zones++;
					^^^
Fixes 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target")
drivers/md/dm-zoned-metadata.c +0 -1
index 516c7b671d25..369de15c4e80 100644
@@ -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:
maintainer
#1 lore raw
Quoted 36 lines · On Wed, Apr 15, 2020 at 01:02:39PM +0200, [email protected] wrote:

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From b8fdd090376a7a46d17db316638fe54b965c2fb0 Mon Sep 17 00:00:00 2001
From: Bob Liu <[email protected]>
Date: Tue, 24 Mar 2020 21:22:45 +0800
Subject: [PATCH] dm zoned: remove duplicate nr_rnd_zones increase in dmz_init_zone()

zmd->nr_rnd_zones was increased twice by mistake. The other place it is increased in dmz_init_zone() is the only one needed:

1131 zmd->nr_useable_zones++;
1132 if (dmz_is_rnd(zone)) {

1133                         zmd->nr_rnd_zones++;
					^^^
Fixes 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target")
drivers/md/dm-zoned-metadata.c +0 -0
index 516c7b671d25..369de15c4e80 100644

drivers/md/dm-zoned-metadata.c static int dmz_init_zone(struct blk_zone *blkz, unsigned int idx, void *data) · line 1114

Quoted 7 lines
drivers/md/dm-zoned-metadata.c +0 -1
@@ -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:

The code on older kernels was using is/else construct instead of a switch. I've adjusted the patch and queued it up.

Signature · 2 lines
Thanks,
Sasha
#2 lore raw
Quoted 32 lines · Sasha Levin
Quoted 31 lines · On Wed, Apr 15, 2020 at 01:02:39PM +0200, [email protected] wrote:

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From b8fdd090376a7a46d17db316638fe54b965c2fb0 Mon Sep 17 00:00:00 2001
From: Bob Liu <[email protected]>
Date: Tue, 24 Mar 2020 21:22:45 +0800
Subject: [PATCH] dm zoned: remove duplicate nr_rnd_zones increase in dmz_init_zone()

zmd->nr_rnd_zones was increased twice by mistake. The other place it is increased in dmz_init_zone() is the only one needed:

1131 zmd->nr_useable_zones++;
1132 if (dmz_is_rnd(zone)) {

1133                         zmd->nr_rnd_zones++;
					^^^
Fixes 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target")
Quoted 16 lines

drivers/md/dm-zoned-metadata.c static int dmz_init_zone(struct blk_zone *blkz, unsigned int idx, void *data) · line 1114

Quoted 12 lines
drivers/md/dm-zoned-metadata.c +0 -1
index 516c7b671d25..369de15c4e80 100644
@@ -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:

The code on older kernels was using is/else construct instead of a switch. I've adjusted the patch and queued it up.

I was about to do that. You saved me time :)
Thanks !

Signature · 2 lines
Damien Le Moal
Western Digital Research