aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/debug.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-04-02 15:12:49 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-05-21 20:14:15 -0400
commitc02e5b57283ad6fd8dec8d834bd340bf2627fcee (patch)
tree8ade6f27a1447fcead8be2ad0da70b416e11b524 /fs/bcachefs/debug.c
parentbcachefs: Initialize c->name earlier on single dev filesystems (diff)
downloadlinux-rng-c02e5b57283ad6fd8dec8d834bd340bf2627fcee.tar.xz
linux-rng-c02e5b57283ad6fd8dec8d834bd340bf2627fcee.zip
bcachefs: Single device mode
Single device filesystems are now identified by the block device name, not the UUID - and single device filesystems with the same UUID can be mounted simultaneously, without any special options. This allocates a new bit in the superblock, BCH_SB_MULTI_DEVICE, which indicates whether a filesystem has ever been multi device. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/debug.c')
-rw-r--r--fs/bcachefs/debug.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c
index 2c52a2c6502b..312f5ce7cba9 100644
--- a/fs/bcachefs/debug.c
+++ b/fs/bcachefs/debug.c
@@ -933,7 +933,11 @@ void bch2_fs_debug_init(struct bch_fs *c)
if (IS_ERR_OR_NULL(bch_debug))
return;
- snprintf(name, sizeof(name), "%pU", c->sb.user_uuid.b);
+ if (c->sb.multi_device)
+ snprintf(name, sizeof(name), "%pU", c->sb.user_uuid.b);
+ else
+ strscpy(name, c->name, sizeof(name));
+
c->fs_debug_dir = debugfs_create_dir(name, bch_debug);
if (IS_ERR_OR_NULL(c->fs_debug_dir))
return;