Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Al Viro and committed by
Christoph Hellwig
f19e4ed1 ff4dd081

-11
-11
fs/configfs/dir.c
··· 1771 1771 struct dentry *dentry = group->cg_item.ci_dentry; 1772 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 1774 inode_lock_nested(d_inode(parent), I_MUTEX_PARENT); 1785 1775 spin_lock(&configfs_dirent_lock); 1786 1776 configfs_detach_prep(dentry, NULL); ··· 1786 1796 dput(dentry); 1787 1797 1788 1798 mutex_lock(&subsys->su_mutex); 1789 - unlink_group: 1790 1799 unlink_group(group); 1791 1800 mutex_unlock(&subsys->su_mutex); 1792 1801 }