Skip to content
Commit e509d6e9 authored by Al Viro's avatar Al Viro
Browse files

autofs_clear_leaf_automount_flags(): use ino->count instead of ->d_subdirs



We want to find out if the parent will become empty after we remove
the victim of rmdir().  Checking if the victim is the only element
of parent's ->d_subdirs is completely wrong - e.g. opening the parent
will end up with a cursor added to its ->d_parent and fooling the
check.

We do maintain ino->count - 0 for anything removed, 1 + number of
children for anything live.  Which gives us precisely what we need
for that check...

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 5f68056c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment