Skip to content

Commit

Permalink
Btrfs: create the uuid tree on remount rw
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Josef Bacik authored and Chris Mason committed Sep 21, 2013
1 parent cbf8b8c commit 94aebfb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 94aebfb

Please sign in to comment.