From: Josef Bacik Date: Sat, 21 Sep 2013 02:33:20 +0000 (-0400) Subject: Btrfs: create the uuid tree on remount rw X-Git-Tag: v3.12-rc2~5^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94aebfb2e7d83748d882992196cb05dd39ba1807;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 6ab0df5..e913328 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) pr_warn("btrfs: failed to resume dev_replace\n"); goto restore; } + + if (!fs_info->uuid_root) { + pr_info("btrfs: creating UUID tree\n"); + ret = btrfs_create_uuid_tree(fs_info); + if (ret) { + pr_warn("btrfs: failed to create the uuid tree" + "%d\n", ret); + goto restore; + } + } sb->s_flags &= ~MS_RDONLY; } out: