diff options
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b74a831fab19..7e4b2c1b4a56 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -448,6 +448,9 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
448 | char *goodnames = ".."; | 448 | char *goodnames = ".."; |
449 | unsigned long nr; | 449 | unsigned long nr; |
450 | 450 | ||
451 | if (inode->i_size > BTRFS_EMPTY_DIR_SIZE) | ||
452 | return -ENOTEMPTY; | ||
453 | |||
451 | path = btrfs_alloc_path(); | 454 | path = btrfs_alloc_path(); |
452 | BUG_ON(!path); | 455 | BUG_ON(!path); |
453 | mutex_lock(&root->fs_info->fs_mutex); | 456 | mutex_lock(&root->fs_info->fs_mutex); |
@@ -501,9 +504,9 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
501 | out: | 504 | out: |
502 | btrfs_release_path(root, path); | 505 | btrfs_release_path(root, path); |
503 | btrfs_free_path(path); | 506 | btrfs_free_path(path); |
504 | mutex_unlock(&root->fs_info->fs_mutex); | ||
505 | nr = trans->blocks_used; | 507 | nr = trans->blocks_used; |
506 | ret = btrfs_end_transaction(trans, root); | 508 | ret = btrfs_end_transaction(trans, root); |
509 | mutex_unlock(&root->fs_info->fs_mutex); | ||
507 | btrfs_btree_balance_dirty(root, nr); | 510 | btrfs_btree_balance_dirty(root, nr); |
508 | if (ret && !err) | 511 | if (ret && !err) |
509 | err = ret; | 512 | err = ret; |