diff options
author | Louis Rilling <Louis.Rilling@kerlabs.com> | 2008-06-12 11:26:47 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-07-14 16:57:16 -0400 |
commit | e75206517504461778c283b942440ef312e437d5 (patch) | |
tree | a0acb0d8cc4527fc00560d7b78a971100fba7f57 /fs/configfs | |
parent | 11c3b79218390a139f2d474ee1e983a672d5839a (diff) |
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 <Louis.Rilling@kerlabs.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/configfs')
-rw-r--r-- | fs/configfs/symlink.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c index faeb4417a10d..0004d18c40ac 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 | |||
140 | goto out_put; | 140 | goto out_put; |
141 | 141 | ||
142 | ret = type->ct_item_ops->allow_link(parent_item, target_item); | 142 | ret = type->ct_item_ops->allow_link(parent_item, target_item); |
143 | if (!ret) | 143 | if (!ret) { |
144 | ret = create_link(parent_item, target_item, dentry); | 144 | ret = create_link(parent_item, target_item, dentry); |
145 | if (ret && type->ct_item_ops->drop_link) | ||
146 | type->ct_item_ops->drop_link(parent_item, | ||
147 | target_item); | ||
148 | } | ||
145 | 149 | ||
146 | config_item_put(target_item); | 150 | config_item_put(target_item); |
147 | path_put(&nd.path); | 151 | path_put(&nd.path); |