Skip to content

Commit f19e4ed

Browse files
Al ViroChristoph Hellwig
authored andcommitted
configfs_register_group() shouldn't be (and isn't) called in rmdirable 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]>
1 parent ff4dd08 commit f19e4ed

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

fs/configfs/dir.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,16 +1771,6 @@ void configfs_unregister_group(struct config_group *group)
17711771
struct dentry *dentry = group->cg_item.ci_dentry;
17721772
struct dentry *parent = group->cg_item.ci_parent->ci_dentry;
17731773

1774-
mutex_lock(&subsys->su_mutex);
1775-
if (!group->cg_item.ci_parent->ci_group) {
1776-
/*
1777-
* The parent has already been unlinked and detached
1778-
* due to a rmdir.
1779-
*/
1780-
goto unlink_group;
1781-
}
1782-
mutex_unlock(&subsys->su_mutex);
1783-
17841774
inode_lock_nested(d_inode(parent), I_MUTEX_PARENT);
17851775
spin_lock(&configfs_dirent_lock);
17861776
configfs_detach_prep(dentry, NULL);
@@ -1796,7 +1786,6 @@ void configfs_unregister_group(struct config_group *group)
17961786
dput(dentry);
17971787

17981788
mutex_lock(&subsys->su_mutex);
1799-
unlink_group:
18001789
unlink_group(group);
18011790
mutex_unlock(&subsys->su_mutex);
18021791
}

0 commit comments

Comments
 (0)