Commit 01cd3367 authored by Josef Bacik's avatar Josef Bacik

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: default avatarJosef Bacik <jbacik@fusionio.com>
parent c69b26b0
...@@ -4941,9 +4941,11 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry) ...@@ -4941,9 +4941,11 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
if (!(inode->i_sb->s_flags & MS_RDONLY)) if (!(inode->i_sb->s_flags & MS_RDONLY))
ret = btrfs_orphan_cleanup(sub_root); ret = btrfs_orphan_cleanup(sub_root);
up_read(&root->fs_info->cleanup_work_sem); up_read(&root->fs_info->cleanup_work_sem);
if (ret) if (ret) {
iput(inode);
inode = ERR_PTR(ret); inode = ERR_PTR(ret);
} }
}
return inode; return inode;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment