aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-09-20 22:33:20 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-21 11:50:43 -0400
commit94aebfb2e7d83748d882992196cb05dd39ba1807 (patch)
treed18b77aca3d6efe5b61c95c6b51e630d387eec4b /fs
parentcbf8b8ca3ec799c11a4cbb29d812d84adf2990b0 (diff)
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 <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/super.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 6ab0df59b6c4..e913328d0f2a 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1383,6 +1383,16 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
1383 pr_warn("btrfs: failed to resume dev_replace\n"); 1383 pr_warn("btrfs: failed to resume dev_replace\n");
1384 goto restore; 1384 goto restore;
1385 } 1385 }
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 }
1386 sb->s_flags &= ~MS_RDONLY; 1396 sb->s_flags &= ~MS_RDONLY;
1387 } 1397 }
1388out: 1398out: