projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca2037f
)
btrfs: hold a ref on the root in btrfs_check_uuid_tree_entry
author
Josef Bacik
<josef@toxicpanda.com>
Fri, 24 Jan 2020 14:32:52 +0000
(09:32 -0500)
committer
David Sterba
<dsterba@suse.com>
Mon, 23 Mar 2020 16:01:31 +0000
(17:01 +0100)
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>
fs/btrfs/volumes.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/btrfs/volumes.c
b/fs/btrfs/volumes.c
index 0b3167bd9f35cc433de26196d83695745b5ccf02..3fca9f9e3b5d863b2c78fa2544d46c4729b99ba5 100644
(file)
--- a/
fs/btrfs/volumes.c
+++ b/
fs/btrfs/volumes.c
@@
-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;
}