We're doing an arbitrary lookup on an fs_root, we need to hold a ref on
that root.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
return PTR_ERR(root);
}
+ if (!btrfs_grab_fs_root(root))
+ return 0;
+
if (btrfs_root_readonly(root)) {
srcu_read_unlock(&fs_info->subvol_srcu, index);
return 0;
key.offset = 0;
inode = btrfs_iget(fs_info->sb, &key, root);
+ btrfs_put_fs_root(root);
if (IS_ERR(inode)) {
srcu_read_unlock(&fs_info->subvol_srcu, index);
return 0;