mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
btrfs: hold a ref on the root in btrfs_check_uuid_tree_entry
We lookup the uuid of arbitrary subvolumes, hold a ref on the root while we're doing this. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ca2037fba6
commit
fbb0ce40d6
1 changed files with 5 additions and 1 deletions
|
@ -4431,6 +4431,10 @@ static int btrfs_check_uuid_tree_entry(struct btrfs_fs_info *fs_info,
|
|||
ret = 1;
|
||||
goto out;
|
||||
}
|
||||
if (!btrfs_grab_fs_root(subvol_root)) {
|
||||
ret = 1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case BTRFS_UUID_KEY_SUBVOL:
|
||||
|
@ -4443,7 +4447,7 @@ static int btrfs_check_uuid_tree_entry(struct btrfs_fs_info *fs_info,
|
|||
ret = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
btrfs_put_fs_root(subvol_root);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue