aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index ccc4f1121210..d3585cb6483c 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3629,12 +3629,14 @@ static int btrfs_dentry_delete(struct dentry *dentry)
3629{ 3629{
3630 struct btrfs_root *root; 3630 struct btrfs_root *root;
3631 3631
3632 if (!dentry->d_inode) 3632 if (!dentry->d_inode && !IS_ROOT(dentry))
3633 return 0; 3633 dentry = dentry->d_parent;
3634 3634
3635 root = BTRFS_I(dentry->d_inode)->root; 3635 if (dentry->d_inode) {
3636 if (btrfs_root_refs(&root->root_item) == 0) 3636 root = BTRFS_I(dentry->d_inode)->root;
3637 return 1; 3637 if (btrfs_root_refs(&root->root_item) == 0)
3638 return 1;
3639 }
3638 return 0; 3640 return 0;
3639} 3641}
3640 3642