author: Al Viro <viro@zeniv.linux.org.uk> 2019-09-17 22:16:58 -0400
committer: Al Viro <viro@zeniv.linux.org.uk> 2019-09-17 22:16:58 -0400
commit: e509d6e9c1ab54af257d4ed95b30d41e3d786857
parent: 5f68056ca50fdd3954a93ae66fea7452abddb66f
Commit Summary:
Diffstat:
1 file changed, 1 insertion, 5 deletions
diff --git a/fs/autofs/root.c b/fs/autofs/root.c
index 29abafc0ce31..2065281ee8b1 100644
--- a/fs/autofs/root.c
+++ b/fs/autofs/root.c
@@ -660,7 +660,6 @@ static void autofs_set_leaf_automount_flags(struct dentry *dentry)
static void autofs_clear_leaf_automount_flags(struct dentry *dentry)
{
- struct list_head *d_child;
struct dentry *parent;
/* flags for dentrys in the root are handled elsewhere */
@@ -673,10 +672,7 @@ static void autofs_clear_leaf_automount_flags(struct dentry *dentry)
/* only consider parents below dentrys in the root */
if (IS_ROOT(parent->d_parent))
return;
- d_child = &dentry->d_child;
- /* Set parent managed if it's becoming empty */
- if (d_child->next == &parent->d_subdirs &&
- d_child->prev == &parent->d_subdirs)
+ if (atomic_read(&autofs_dentry_ino(parent)->count) == 2)
managed_dentry_set_managed(parent);
}