public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6.1 0/2] btrfs: stable backport for multidevice btrfs zone (de)activation
@ 2025-04-17 12:05 Johannes Thumshirn
  2025-04-17 12:05 ` [PATCH v6.1 1/2] btrfs: zoned: fix zone activation with missing devices Johannes Thumshirn
  2025-04-17 12:05 ` [PATCH v6.1 2/2] btrfs: zoned: fix zone finishing " Johannes Thumshirn
  0 siblings, 2 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2025-04-17 12:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-btrfs, stable, Johannes Thumshirn

Hi Greg,

   Here's the backport for btrfs' multidevice zone (de)activation that failed
   to apply to your v6.1 branch.

Johannes Thumshirn (2):
  btrfs: zoned: fix zone activation with missing devices
  btrfs: zoned: fix zone finishing with missing devices

 fs/btrfs/zoned.c | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v6.1 1/2] btrfs: zoned: fix zone activation with missing devices
  2025-04-17 12:05 [PATCH v6.1 0/2] btrfs: stable backport for multidevice btrfs zone (de)activation Johannes Thumshirn
@ 2025-04-17 12:05 ` Johannes Thumshirn
  2025-04-18 15:42   ` Sasha Levin
  2025-04-17 12:05 ` [PATCH v6.1 2/2] btrfs: zoned: fix zone finishing " Johannes Thumshirn
  1 sibling, 1 reply; 5+ messages in thread
From: Johannes Thumshirn @ 2025-04-17 12:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-btrfs, stable, Johannes Thumshirn, Naohiro Aota, Anand Jain,
	David Sterba

From: Johannes Thumshirn <johannes.thumshirn@wdc.com>

commit 2bbc4a45e5eb6b868357c1045bf6f38f6ba576e0 upstream

If btrfs_zone_activate() is called with a filesystem that has missing
devices (e.g. a RAID file system mounted in degraded mode) it is accessing
the btrfs_device::zone_info pointer, which will not be set if the device in
question is missing.

Check if the device is present (by checking if it has a valid block
device pointer associated) and if not, skip zone activation for it.

Fixes: f9a912a3c45f ("btrfs: zoned: make zone activation multi stripe capable")
CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/zoned.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 794526ab90d2..46aadef5a463 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -1909,6 +1909,9 @@ bool btrfs_zone_activate(struct btrfs_block_group *block_group)
 		device = map->stripes[i].dev;
 		physical = map->stripes[i].physical;
 
+		if (!device->bdev)
+			continue;
+
 		if (device->zone_info->max_active_zones == 0)
 			continue;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v6.1 2/2] btrfs: zoned: fix zone finishing with missing devices
  2025-04-17 12:05 [PATCH v6.1 0/2] btrfs: stable backport for multidevice btrfs zone (de)activation Johannes Thumshirn
  2025-04-17 12:05 ` [PATCH v6.1 1/2] btrfs: zoned: fix zone activation with missing devices Johannes Thumshirn
@ 2025-04-17 12:05 ` Johannes Thumshirn
  2025-04-18 15:42   ` Sasha Levin
  1 sibling, 1 reply; 5+ messages in thread
From: Johannes Thumshirn @ 2025-04-17 12:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-btrfs, stable, Johannes Thumshirn, Naohiro Aota, Anand Jain,
	David Sterba

From: Johannes Thumshirn <johannes.thumshirn@wdc.com>

commit 35fec1089ebb5617f85884d3fa6a699ce6337a75 upstream

If do_zone_finish() is called with a filesystem that has missing devices
(e.g. a RAID file system mounted in degraded mode) it is accessing the
btrfs_device::zone_info pointer, which will not be set if the device
in question is missing.

Check if the device is present (by checking if it has a valid block device
pointer associated) and if not, skip zone finishing for it.

Fixes: 4dcbb8ab31c1 ("btrfs: zoned: make zone finishing multi stripe capable")
CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/zoned.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 46aadef5a463..1dff64e62047 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -2055,6 +2055,9 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ
 		struct btrfs_device *device = map->stripes[i].dev;
 		const u64 physical = map->stripes[i].physical;
 
+		if (!device->bdev)
+			continue;
+
 		if (device->zone_info->max_active_zones == 0)
 			continue;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v6.1 1/2] btrfs: zoned: fix zone activation with missing devices
  2025-04-17 12:05 ` [PATCH v6.1 1/2] btrfs: zoned: fix zone activation with missing devices Johannes Thumshirn
@ 2025-04-18 15:42   ` Sasha Levin
  0 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2025-04-18 15:42 UTC (permalink / raw)
  To: stable; +Cc: Johannes Thumshirn, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

The upstream commit SHA1 provided is correct: 2bbc4a45e5eb6b868357c1045bf6f38f6ba576e0

WARNING: Author mismatch between patch and upstream commit:
Backport author: Johannes Thumshirn<jth@kernel.org>
Commit author: Johannes Thumshirn<johannes.thumshirn@wdc.com>

Status in newer kernel trees:
6.14.y | Not found
6.13.y | Not found
6.12.y | Not found
6.6.y | Not found

Note: The patch differs from the upstream commit:
---
1:  2bbc4a45e5eb6 < -:  ------------- btrfs: zoned: fix zone activation with missing devices
-:  ------------- > 1:  abb5ad2758783 btrfs: zoned: fix zone activation with missing devices
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y        |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v6.1 2/2] btrfs: zoned: fix zone finishing with missing devices
  2025-04-17 12:05 ` [PATCH v6.1 2/2] btrfs: zoned: fix zone finishing " Johannes Thumshirn
@ 2025-04-18 15:42   ` Sasha Levin
  0 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2025-04-18 15:42 UTC (permalink / raw)
  To: stable; +Cc: Johannes Thumshirn, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

The upstream commit SHA1 provided is correct: 35fec1089ebb5617f85884d3fa6a699ce6337a75

WARNING: Author mismatch between patch and upstream commit:
Backport author: Johannes Thumshirn<jth@kernel.org>
Commit author: Johannes Thumshirn<johannes.thumshirn@wdc.com>

Status in newer kernel trees:
6.14.y | Not found
6.13.y | Not found
6.12.y | Not found
6.6.y | Not found

Note: The patch differs from the upstream commit:
---
1:  35fec1089ebb5 < -:  ------------- btrfs: zoned: fix zone finishing with missing devices
-:  ------------- > 1:  a47a1104867b3 btrfs: zoned: fix zone finishing with missing devices
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.6.y        |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-18 15:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 12:05 [PATCH v6.1 0/2] btrfs: stable backport for multidevice btrfs zone (de)activation Johannes Thumshirn
2025-04-17 12:05 ` [PATCH v6.1 1/2] btrfs: zoned: fix zone activation with missing devices Johannes Thumshirn
2025-04-18 15:42   ` Sasha Levin
2025-04-17 12:05 ` [PATCH v6.1 2/2] btrfs: zoned: fix zone finishing " Johannes Thumshirn
2025-04-18 15:42   ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox