Skip to content

Commit

Permalink
NFS: If nfs_mountpoint_expiry_timeout < 0, do not expire submounts
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust committed Nov 4, 2019
1 parent a99d808 commit 22a1ae9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/nfs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 22a1ae9

Please sign in to comment.