Skip to content

Commit 94aebfb

Browse files
Josef BacikChris Mason
authored andcommitted
Btrfs: create the uuid tree on remount rw
Users have been complaining of the uuid tree stuff warning that there is no uuid root when trying to do snapshot operations. This is because if you mount -o ro we will not create the uuid tree. But then if you mount -o rw,remount we will still not create it and then any subsequent snapshot/subvol operations you try to do will fail gloriously. Fix this by creating the uuid_root on remount rw if it was not already there. Thanks, Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent cbf8b8c commit 94aebfb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fs/btrfs/super.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,16 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
13831383
pr_warn("btrfs: failed to resume dev_replace\n");
13841384
goto restore;
13851385
}
1386+
1387+
if (!fs_info->uuid_root) {
1388+
pr_info("btrfs: creating UUID tree\n");
1389+
ret = btrfs_create_uuid_tree(fs_info);
1390+
if (ret) {
1391+
pr_warn("btrfs: failed to create the uuid tree"
1392+
"%d\n", ret);
1393+
goto restore;
1394+
}
1395+
}
13861396
sb->s_flags &= ~MS_RDONLY;
13871397
}
13881398
out:

0 commit comments

Comments
 (0)