Skip to content

Commit

Permalink
configfs_register_group() shouldn't be (and isn't) called in rmdirabl…
Browse files Browse the repository at this point in the history
…e parts

revert cc57c07 "configfs: fix registered group removal"
It was an attempt to handle something that fundamentally doesn't
work - configfs_register_group() should never be done in a part
of tree that can be rmdir'ed.  And in mainline it never had been,
so let's not borrow trouble; the fix was racy anyway, it would take
a lot more to make that work and desired semantics is not clear.

Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
Al Viro authored and Christoph Hellwig committed Sep 2, 2019
1 parent ff4dd08 commit f19e4ed
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions fs/configfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,16 +1771,6 @@ void configfs_unregister_group(struct config_group *group)
struct dentry *dentry = group->cg_item.ci_dentry;
struct dentry *parent = group->cg_item.ci_parent->ci_dentry;

mutex_lock(&subsys->su_mutex);
if (!group->cg_item.ci_parent->ci_group) {
/*
* The parent has already been unlinked and detached
* due to a rmdir.
*/
goto unlink_group;
}
mutex_unlock(&subsys->su_mutex);

inode_lock_nested(d_inode(parent), I_MUTEX_PARENT);
spin_lock(&configfs_dirent_lock);
configfs_detach_prep(dentry, NULL);
Expand All @@ -1796,7 +1786,6 @@ void configfs_unregister_group(struct config_group *group)
dput(dentry);

mutex_lock(&subsys->su_mutex);
unlink_group:
unlink_group(group);
mutex_unlock(&subsys->su_mutex);
}
Expand Down

0 comments on commit f19e4ed

Please sign in to comment.