summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2023-10-04 23:00:25 +0800
committerDavid Sterba <dsterba@suse.com>2023-10-12 16:44:18 +0200
commitc47b02c1bddf7c4d56e01bccc99e73ae5309fe07 (patch)
treee7e46086f782ace8d8a2f27bfd9855c05c08c790 /fs/btrfs/volumes.c
parent000331bb0350366219887d14ae8a921ae9e72269 (diff)
downloadlinux-c47b02c1bddf7c4d56e01bccc99e73ae5309fe07.tar.gz
linux-c47b02c1bddf7c4d56e01bccc99e73ae5309fe07.tar.bz2
linux-c47b02c1bddf7c4d56e01bccc99e73ae5309fe07.zip
btrfs: disable the seed feature for temp-fsid
A seed device is an integral component of the sprout device, which functions as a multi-device filesystem. Therefore, temp-fsid feature is not supported. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 81b735f4efc1..1fdfa9153e30 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -571,6 +571,14 @@ static struct btrfs_fs_devices *find_fsid_by_device(
if (btrfs_super_num_devices(disk_super) != 1)
return fsid_fs_devices;
+ /*
+ * A seed device is an integral component of the sprout device, which
+ * functions as a multi-device filesystem. So, temp-fsid feature is
+ * not supported.
+ */
+ if (btrfs_super_flags(disk_super) & BTRFS_SUPER_FLAG_SEEDING)
+ return fsid_fs_devices;
+
/* Try to find a fs_devices by matching devt. */
list_for_each_entry(devt_fs_devices, &fs_uuids, fs_list) {
struct btrfs_device *device;