diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-08-29 23:13:30 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-09-02 16:10:44 -0400 |
commit | f19e4ed1e1edbfa3c9ccb9fed17759b7d6db24c6 (patch) | |
tree | cac1dc8ff820a50b2c9dfed61bc552a6935edca0 | |
parent | ff4dd081977da56566a848f071aed8fa92d604a1 (diff) |
configfs_register_group() shouldn't be (and isn't) called in rmdirable parts
revert cc57c07343bd "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 <viro@zeniv.linux.org.uk>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | fs/configfs/dir.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 92112915de8e..21a795679e20 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
@@ -1771,16 +1771,6 @@ void configfs_unregister_group(struct config_group *group) | |||
1771 | struct dentry *dentry = group->cg_item.ci_dentry; | 1771 | struct dentry *dentry = group->cg_item.ci_dentry; |
1772 | struct dentry *parent = group->cg_item.ci_parent->ci_dentry; | 1772 | struct dentry *parent = group->cg_item.ci_parent->ci_dentry; |
1773 | 1773 | ||
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 | |||
1784 | inode_lock_nested(d_inode(parent), I_MUTEX_PARENT); | 1774 | inode_lock_nested(d_inode(parent), I_MUTEX_PARENT); |
1785 | spin_lock(&configfs_dirent_lock); | 1775 | spin_lock(&configfs_dirent_lock); |
1786 | configfs_detach_prep(dentry, NULL); | 1776 | configfs_detach_prep(dentry, NULL); |
@@ -1796,7 +1786,6 @@ void configfs_unregister_group(struct config_group *group) | |||
1796 | dput(dentry); | 1786 | dput(dentry); |
1797 | 1787 | ||
1798 | mutex_lock(&subsys->su_mutex); | 1788 | mutex_lock(&subsys->su_mutex); |
1799 | unlink_group: | ||
1800 | unlink_group(group); | 1789 | unlink_group(group); |
1801 | mutex_unlock(&subsys->su_mutex); | 1790 | mutex_unlock(&subsys->su_mutex); |
1802 | } | 1791 | } |