aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-06-03 21:39:49 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-06-14 11:30:16 -0400
commit01cd33674e95296e1647da3534b9aef1e98556b5 (patch)
tree2d7f1e1f088c546266a5a7f01782c9374982ac93 /fs/btrfs
parentc69b26b0116dc2c064457991bec91b6d94e96d65 (diff)
Btrfs: put our inode if orphan cleanup fails
When we cross into a different subvol when doing a lookup we will run the orhpan cleanup. If this fails however we do not drop the ref to the inode we were looking up before we return an error, which leads to busy inodes on umount. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index c52ceb8c24e0..a2df4690b000 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4941,8 +4941,10 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
4941 if (!(inode->i_sb->s_flags & MS_RDONLY)) 4941 if (!(inode->i_sb->s_flags & MS_RDONLY))
4942 ret = btrfs_orphan_cleanup(sub_root); 4942 ret = btrfs_orphan_cleanup(sub_root);
4943 up_read(&root->fs_info->cleanup_work_sem); 4943 up_read(&root->fs_info->cleanup_work_sem);
4944 if (ret) 4944 if (ret) {
4945 iput(inode);
4945 inode = ERR_PTR(ret); 4946 inode = ERR_PTR(ret);
4947 }
4946 } 4948 }
4947 4949
4948 return inode; 4950 return inode;