NFS: If nfs_mountpoint_expiry_timeout < 0, do not expire submounts
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 21 Aug 2019 22:16:28 +0000 (18:16 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Nov 2019 02:28:44 +0000 (21:28 -0500)
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>
fs/nfs/namespace.c

index 9287eb6..5e0e9d2 100644 (file)
@@ -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);