[PATCH 2/3] fs: namei: Allow follow_down() to uncover auto mounts

From: Richard Weinberger
Date: Thu Nov 17 2022 - 14:12:20 EST


This function is only used by NFSD to cross mount points.
If a mount point is of type auto mount, follow_down() will
not uncover it. Add LOOKUP_AUTOMOUNT to the lookup flags
to have ->d_automount() called when NFSD walks down the
mount tree.

Signed-off-by: Richard Weinberger <richard@xxxxxx>
---
fs/namei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namei.c b/fs/namei.c
index 578c2110df02..000c4b84e6be 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1462,7 +1462,7 @@ int follow_down(struct path *path)
{
struct vfsmount *mnt = path->mnt;
bool jumped;
- int ret = traverse_mounts(path, &jumped, NULL, 0);
+ int ret = traverse_mounts(path, &jumped, NULL, LOOKUP_AUTOMOUNT);

if (path->mnt != mnt)
mntput(mnt);
--
2.26.2