autofs: fix clearing AUTOFS_EXP_LEAVES in autofs_expire_indirect()
authorIan Kent <raven@themaw.net>
Wed, 22 Aug 2018 04:58:48 +0000 (21:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 22 Aug 2018 17:52:49 +0000 (10:52 -0700)
The expire flag AUTOFS_EXP_LEAVES is cleared before the second call to
should_expire() in autofs_expire_indirect() but the parameter passed in
the second call is incorrect.

Fortunately AUTOFS_EXP_LEAVES expire flag has not been used for a long
time but might be needed in the future so fix it rather than remove the
expire leaves functionality.

Link: http://lkml.kernel.org/r/152937732410.21213.7447294898147765076.stgit@pluto.themaw.net
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/autofs/expire.c

index 295feec10ea6a7730b1291f59a456ff8d4617d34..41855cdc56308e9ad7ef7573fd196e9f8bb2ae72 100644 (file)
@@ -467,7 +467,7 @@ struct dentry *autofs_expire_indirect(struct super_block *sb,
                 * things have changed.
                 */
                flags &= ~AUTOFS_EXP_LEAVES;
-               found = should_expire(expired, mnt, timeout, how);
+               found = should_expire(expired, mnt, timeout, flags);
                if (!found || found != expired)
                        /* Something has changed, continue */
                        goto next;