From: Louis Rilling Date: Thu, 12 Jun 2008 15:26:47 +0000 (+0200) Subject: configfs: call drop_link() to cleanup after create_link() failure X-Git-Tag: v2.6.27-rc1~1036^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e75206517504461778c283b942440ef312e437d5;p=linux-2.6 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: Louis Rilling Signed-off-by: Joel Becker --- diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c index faeb4417a1..0004d18c40 100644 --- a/fs/configfs/symlink.c +++ b/fs/configfs/symlink.c @@ -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);