summaryrefslogtreecommitdiffstats
path: root/fs/nfs/namespace.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-08-22 00:16:28 +0200
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-11-04 03:28:44 +0100
commit22a1ae9a93fb64600d0756e8f8051d65527f6786 (patch)
treee4464a85ef1102e81643fbf7565f58e6e1f4ac23 /fs/nfs/namespace.c
parentLinux 5.4-rc6 (diff)
downloadlinux-22a1ae9a93fb64600d0756e8f8051d65527f6786.tar.xz
linux-22a1ae9a93fb64600d0756e8f8051d65527f6786.zip
NFS: If nfs_mountpoint_expiry_timeout < 0, do not expire submounts
If we set nfs_mountpoint_expiry_timeout to a negative value, then allow that to imply that we do not expire NFSv4 submounts. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/namespace.c')
-rw-r--r--fs/nfs/namespace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index 9287eb666322..5e0e9d29f5c5 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -157,6 +157,9 @@ struct vfsmount *nfs_d_automount(struct path *path)
if (IS_ERR(mnt))
goto out;
+ if (nfs_mountpoint_expiry_timeout < 0)
+ goto out;
+
mntget(mnt); /* prevent immediate expiration */
mnt_set_expiry(mnt, &nfs_automount_list);
schedule_delayed_work(&nfs_automount_task, nfs_mountpoint_expiry_timeout);