diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-04-02 15:12:49 -0400 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-05-21 20:14:15 -0400 |
| commit | c02e5b57283ad6fd8dec8d834bd340bf2627fcee (patch) | |
| tree | 8ade6f27a1447fcead8be2ad0da70b416e11b524 /fs/bcachefs/fs.c | |
| parent | bcachefs: Initialize c->name earlier on single dev filesystems (diff) | |
| download | linux-c02e5b57283ad6fd8dec8d834bd340bf2627fcee.tar.gz linux-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/fs.c')
| -rw-r--r-- | fs/bcachefs/fs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index 47f1a64c5c8d..672326693f73 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -2514,7 +2514,12 @@ got_sb: sb->s_time_min = div_s64(S64_MIN, c->sb.time_units_per_sec) + 1; sb->s_time_max = div_s64(S64_MAX, c->sb.time_units_per_sec); super_set_uuid(sb, c->sb.user_uuid.b, sizeof(c->sb.user_uuid)); - super_set_sysfs_name_uuid(sb); + + if (c->sb.multi_device) + super_set_sysfs_name_uuid(sb); + else + strscpy(sb->s_sysfs_name, c->name, sizeof(sb->s_sysfs_name)); + sb->s_shrink->seeks = 0; c->vfs_sb = sb; strscpy(sb->s_id, c->name, sizeof(sb->s_id)); |
