mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
Btrfs: call inode_dec_link_count() on mkdir error path
In btrfs_mkdir(), if it fails to create dir, we should clean up existed items, setting inode's link properly to make sure it could be cleaned up properly. Signed-off-by: Wang Shilong <wangshilong1991@gmail.com> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
parent
df95e7f0d9
commit
c7cfb8a540
@ -6255,8 +6255,10 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||
|
||||
out_fail:
|
||||
btrfs_end_transaction(trans, root);
|
||||
if (drop_on_err)
|
||||
if (drop_on_err) {
|
||||
inode_dec_link_count(inode);
|
||||
iput(inode);
|
||||
}
|
||||
btrfs_balance_delayed_items(root);
|
||||
btrfs_btree_balance_dirty(root);
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user