Skip to content

Commit

Permalink
autofs4 - fix expire check
Browse files Browse the repository at this point in the history
In some cases when an autofs indirect mount is contained in a file
system that is marked as shared (such as when systemd does the
equivalent of "mount --make-rshared /" early in the boot), mounts
stop expiring.

When this happens the first expiry check on a mountpoint dentry in
autofs_expire_indirect() sees a mountpoint dentry with a higher
than minimal reference count. Consequently the dentry is condidered
busy and the actual expiry check is never done.

This particular check was originally meant as an optimisation to
detect a path walk in progress but with the addition of rcu-walk
it can be ineffective anyway.

Removing the test allows automounts to expire again since the
actual expire check doesn't rely on the dentry reference count.

Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ian Kent authored and Linus Torvalds committed Aug 17, 2012
1 parent d987569 commit d807ff8
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions fs/autofs4/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,6 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
DPRINTK("checking mountpoint %p %.*s",
dentry, (int)dentry->d_name.len, dentry->d_name.name);

/* Path walk currently on this dentry? */
ino_count = atomic_read(&ino->count) + 2;
if (dentry->d_count > ino_count)
goto next;

/* Can we umount this guy */
if (autofs4_mount_busy(mnt, dentry))
goto next;
Expand Down

0 comments on commit d807ff8

Please sign in to comment.