提交 e7520651 编写于 作者: L Louis Rilling 提交者: Mark Fasheh

configfs: call drop_link() to cleanup after create_link() failure

When allow_link() succeeds but create_link() fails, the subsystem is not
informed of the failure.

This patch fixes this by calling drop_link() on create_link() failures.
Signed-off-by: NLouis Rilling <Louis.Rilling@kerlabs.com>
Signed-off-by: NJoel Becker <joel.becker@oracle.com>
上级 11c3b792
......@@ -140,8 +140,12 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna
goto out_put;
ret = type->ct_item_ops->allow_link(parent_item, target_item);
if (!ret)
if (!ret) {
ret = create_link(parent_item, target_item, dentry);
if (ret && type->ct_item_ops->drop_link)
type->ct_item_ops->drop_link(parent_item,
target_item);
}
config_item_put(target_item);
path_put(&nd.path);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册