提交 efefb143 编写于 作者: Y Yan, Zheng 提交者: Chris Mason

Btrfs: remove negative dentry when deleting subvolumne

The use of btrfs_dentry_delete is removing dentries from the
dcache when deleting subvolumne. btrfs_dentry_delete ignores
negative dentries. This is incorrect since if we don't remove
the negative dentry, its parent dentry can't be removed.
Signed-off-by: NYan Zheng <zheng.yan@oracle.com>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 ff782e0a
......@@ -3629,12 +3629,14 @@ static int btrfs_dentry_delete(struct dentry *dentry)
{
struct btrfs_root *root;
if (!dentry->d_inode)
return 0;
if (!dentry->d_inode && !IS_ROOT(dentry))
dentry = dentry->d_parent;
root = BTRFS_I(dentry->d_inode)->root;
if (btrfs_root_refs(&root->root_item) == 0)
return 1;
if (dentry->d_inode) {
root = BTRFS_I(dentry->d_inode)->root;
if (btrfs_root_refs(&root->root_item) == 0)
return 1;
}
return 0;
}
......
......@@ -830,6 +830,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
out_unlock:
mutex_unlock(&inode->i_mutex);
if (!err) {
shrink_dcache_sb(root->fs_info->sb);
btrfs_invalidate_inodes(dest);
d_delete(dentry);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册