All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFS: fix minor issues with automount expiry.
@ 2021-07-27 23:15 NeilBrown
  2021-10-04  2:38 ` Trond Myklebust
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2021-07-27 23:15 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker; +Cc: linux-nfs


1/ If automount expiry timeout is set to zero, new mounts are not added
   to the list.  If the timeout is then changed, those previously
   mounts will still not be timed out.  This is probably not what
   would be expected.  Simply refusing to start the timer
   is sufficient to prevent timeout.

2/ the MODULE_PARM_DESC for nfs_mountpoint_expiry_timeout is missing
   a space between to two sentences.  This is hidden by the fact that
   the string is broken onto to line - against current policy.
   So join onto a single (long) line, and add the space.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 fs/nfs/namespace.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index bc0c698f3350..be5e77a80811 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -196,10 +196,10 @@ struct vfsmount *nfs_d_automount(struct path *path)
 		goto out_fc;
 
 	mntget(mnt); /* prevent immediate expiration */
+	mnt_set_expiry(mnt, &nfs_automount_list);
 	if (timeout <= 0)
 		goto out_fc;
 
-	mnt_set_expiry(mnt, &nfs_automount_list);
 	schedule_delayed_work(&nfs_automount_task, timeout);
 
 out_fc:
@@ -366,5 +366,4 @@ static const struct kernel_param_ops param_ops_nfs_timeout = {
 
 module_param(nfs_mountpoint_expiry_timeout, nfs_timeout, 0644);
 MODULE_PARM_DESC(nfs_mountpoint_expiry_timeout,
-		"Set the NFS automounted mountpoint timeout value (seconds)."
-		"Values <= 0 turn expiration off.");
+		"Set the NFS automounted mountpoint timeout value (seconds). Values <= 0 turn expiration off.");
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] NFS: fix minor issues with automount expiry.
  2021-07-27 23:15 [PATCH] NFS: fix minor issues with automount expiry NeilBrown
@ 2021-10-04  2:38 ` Trond Myklebust
  2021-10-04 23:52   ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Trond Myklebust @ 2021-10-04  2:38 UTC (permalink / raw)
  To: neilb, Anna.Schumaker; +Cc: linux-nfs

On Wed, 2021-07-28 at 09:15 +1000, NeilBrown wrote:
> 
> 1/ If automount expiry timeout is set to zero, new mounts are not
> added
>    to the list.  If the timeout is then changed, those previously
>    mounts will still not be timed out.  This is probably not what
>    would be expected.  Simply refusing to start the timer
>    is sufficient to prevent timeout.
> 
> 2/ the MODULE_PARM_DESC for nfs_mountpoint_expiry_timeout is missing
>    a space between to two sentences.  This is hidden by the fact that
>    the string is broken onto to line - against current policy.
>    So join onto a single (long) line, and add the space.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  fs/nfs/namespace.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
> index bc0c698f3350..be5e77a80811 100644
> --- a/fs/nfs/namespace.c
> +++ b/fs/nfs/namespace.c
> @@ -196,10 +196,10 @@ struct vfsmount *nfs_d_automount(struct path
> *path)
>                 goto out_fc;
>  
>         mntget(mnt); /* prevent immediate expiration */
> +       mnt_set_expiry(mnt, &nfs_automount_list);
>         if (timeout <= 0)
>                 goto out_fc;
>  
> -       mnt_set_expiry(mnt, &nfs_automount_list);
>         schedule_delayed_work(&nfs_automount_task, timeout);

NACK.

The existing code is very deliberate about _not_ adding the mountpoint
to the expiration list if the timeout is negative or zero. That's the
whole point. Changing the timeout value after the fact is not supposed
to affect the state of those mountpoints.

>  
>  out_fc:
> @@ -366,5 +366,4 @@ static const struct kernel_param_ops
> param_ops_nfs_timeout = {
>  
>  module_param(nfs_mountpoint_expiry_timeout, nfs_timeout, 0644);
>  MODULE_PARM_DESC(nfs_mountpoint_expiry_timeout,
> -               "Set the NFS automounted mountpoint timeout value
> (seconds)."
> -               "Values <= 0 turn expiration off.");
> +               "Set the NFS automounted mountpoint timeout value
> (seconds). Values <= 0 turn expiration off.");

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] NFS: fix minor issues with automount expiry.
  2021-10-04  2:38 ` Trond Myklebust
@ 2021-10-04 23:52   ` NeilBrown
  0 siblings, 0 replies; 3+ messages in thread
From: NeilBrown @ 2021-10-04 23:52 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Anna.Schumaker, linux-nfs

On Mon, 04 Oct 2021, Trond Myklebust wrote:
> On Wed, 2021-07-28 at 09:15 +1000, NeilBrown wrote:
> > 
> > 1/ If automount expiry timeout is set to zero, new mounts are not
> > added
> >    to the list.  If the timeout is then changed, those previously
> >    mounts will still not be timed out.  This is probably not what
> >    would be expected.  Simply refusing to start the timer
> >    is sufficient to prevent timeout.
> > 
> > 2/ the MODULE_PARM_DESC for nfs_mountpoint_expiry_timeout is missing
> >    a space between to two sentences.  This is hidden by the fact that
> >    the string is broken onto to line - against current policy.
> >    So join onto a single (long) line, and add the space.
> > 
> > Signed-off-by: NeilBrown <neilb@suse.de>
> > ---
> >  fs/nfs/namespace.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
> > index bc0c698f3350..be5e77a80811 100644
> > --- a/fs/nfs/namespace.c
> > +++ b/fs/nfs/namespace.c
> > @@ -196,10 +196,10 @@ struct vfsmount *nfs_d_automount(struct path
> > *path)
> >                 goto out_fc;
> >  
> >         mntget(mnt); /* prevent immediate expiration */
> > +       mnt_set_expiry(mnt, &nfs_automount_list);
> >         if (timeout <= 0)
> >                 goto out_fc;
> >  
> > -       mnt_set_expiry(mnt, &nfs_automount_list);
> >         schedule_delayed_work(&nfs_automount_task, timeout);
> 
> NACK.
> 
> The existing code is very deliberate about _not_ adding the mountpoint
> to the expiration list if the timeout is negative or zero. That's the
> whole point. Changing the timeout value after the fact is not supposed
> to affect the state of those mountpoints.
> 

Thanks for the reply.
It just seemed odd that setting <= 0 would turn expiry off for all
mounts, but setting in > 0 would only turn it back on for some mounts.
Those that were auto-mounted before it was set <= 0.
It's not really important though.

Thanks,
NeilBrown

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-04 23:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27 23:15 [PATCH] NFS: fix minor issues with automount expiry NeilBrown
2021-10-04  2:38 ` Trond Myklebust
2021-10-04 23:52   ` NeilBrown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.