提交 c7cfb8a5 编写于 作者: W Wang Shilong 提交者: Chris Mason

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: NWang Shilong <wangshilong1991@gmail.com>
Signed-off-by: NChris Mason <clm@fb.com>
上级 df95e7f0
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册