Commit e75206517504461778c283b942440ef312e437d5
Committed by
Mark Fasheh
1 parent
11c3b79218
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff
fs/configfs/symlink.c
... | ... | @@ -140,8 +140,12 @@ |
140 | 140 | goto out_put; |
141 | 141 | |
142 | 142 | ret = type->ct_item_ops->allow_link(parent_item, target_item); |
143 | - if (!ret) | |
143 | + if (!ret) { | |
144 | 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 | 150 | config_item_put(target_item); |
147 | 151 | path_put(&nd.path); |