Skip to contentSkip to conversation

FAILED: patch "[PATCH] btrfs: zoned: fix zone activation with missing devices" failed to apply to 6.1-stable tree

PATCH [email protected] 1 participant 1 message Apr 17, 2025

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.1-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]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 2bbc4a45e5eb6b868357c1045bf6f38f6ba576e0
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025041707-saline-acts-ee63@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

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

From 2bbc4a45e5eb6b868357c1045bf6f38f6ba576e0 Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn <[email protected]>
Date: Mon, 17 Mar 2025 12:24:58 +0100
Subject: [PATCH] btrfs: zoned: fix zone activation with missing devices

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")
fs/btrfs/zoned.c +3 -0
index 4956baf8220a..9faf1e097196 100644
@@ -2111,6 +2111,9 @@ bool btrfs_zone_activate(struct btrfs_block_group *block_group)
 		physical = map->stripes[i].physical;
 		zinfo = device->zone_info;
 
+		if (!device->bdev)
+			continue;
+
 		if (zinfo->max_active_zones == 0)
 			continue;