mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: Nix <nix@esperi.org.uk>,
	"Toralf Förster" <toralf.foerster@gmx.de>,
	"Oleg Nesterov" <oleg@redhat.com>,
	"NFS list" <linux-nfs@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"dhowells@redhat.com" <dhowells@redhat.com>
Subject: Re: [3.10.4] NFS locking panic, plus persisting NFS shutdown panic from 3.9.*
Date: Tue, 6 Aug 2013 05:24:06 -0400	[thread overview]
Message-ID: <20130806052406.40f7852f@tlielax.poochiereds.net> (raw)
In-Reply-To: <1375755693.7337.42.camel@leira.trondhjem.org>

On Tue, 6 Aug 2013 02:21:35 +0000
"Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:

> On Mon, 2013-08-05 at 14:33 -0400, Jeff Layton wrote:
> > On Mon, 5 Aug 2013 18:18:03 +0000
> > "Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:
> > 
> > > On Mon, 2013-08-05 at 13:37 -0400, Jeff Layton wrote:
> > > > On Mon, 5 Aug 2013 16:15:01 +0000
> > > > "Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:
> > > > 
> > > > > From 3c50ba80105464a28d456d9a1e0f1d81d4af92a8 Mon Sep 17 00:00:00 2001
> > > > > From: Trond Myklebust <Trond.Myklebust@netapp.com>
> > > > > Date: Mon, 5 Aug 2013 12:06:12 -0400
> > > > > Subject: [PATCH] LOCKD: Don't call utsname()->nodename from
> > > > >  nlmclnt_setlockargs
> > > > > MIME-Version: 1.0
> > > > > Content-Type: text/plain; charset=UTF-8
> > > > > Content-Transfer-Encoding: 8bit
> > > > > 
> > > > > Firstly, nlmclnt_setlockargs can be called from a reclaimer thread, in
> > > > > which case we're in entirely the wrong namespace.
> > > > > Secondly, commit 8aac62706adaaf0fab02c4327761561c8bda9448 (move
> > > > > exit_task_namespaces() outside of exit_notify()) now means that
> > > > > exit_task_work() is called after exit_task_namespaces(), which
> > > > > triggers an Oops when we're freeing up the locks.
> > > > > 
> > > > > Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> > > > > Cc: Toralf Förster <toralf.foerster@gmx.de>
> > > > > Cc: Oleg Nesterov <oleg@redhat.com>
> > > > > Cc: Nix <nix@esperi.org.uk>
> > > > > Cc: Jeff Layton <jlayton@redhat.com>
> > > > > ---
> > > > >  fs/lockd/clntproc.c | 5 +++--
> > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > > 
> > > > > diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
> > > > > index 9760ecb..acd3947 100644
> > > > > --- a/fs/lockd/clntproc.c
> > > > > +++ b/fs/lockd/clntproc.c
> > > > > @@ -125,14 +125,15 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)
> > > > >  {
> > > > >  	struct nlm_args	*argp = &req->a_args;
> > > > >  	struct nlm_lock	*lock = &argp->lock;
> > > > > +	char *nodename = req->a_host->h_rpcclnt->cl_nodename;
> > > > >  
> > > > >  	nlmclnt_next_cookie(&argp->cookie);
> > > > >  	memcpy(&lock->fh, NFS_FH(file_inode(fl->fl_file)), sizeof(struct nfs_fh));
> > > > > -	lock->caller  = utsname()->nodename;
> > > > > +	lock->caller  = nodename;
> > > > >  	lock->oh.data = req->a_owner;
> > > > >  	lock->oh.len  = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s",
> > > > >  				(unsigned int)fl->fl_u.nfs_fl.owner->pid,
> > > > > -				utsname()->nodename);
> > > > > +				nodename);
> > > > >  	lock->svid = fl->fl_u.nfs_fl.owner->pid;
> > > > >  	lock->fl.fl_start = fl->fl_start;
> > > > >  	lock->fl.fl_end = fl->fl_end;
> > > > 
> > > > Looks good to me...
> > > > 
> > > > Reviewed-by: Jeff Layton <jlayton@redhat.com>
> > > > 
> > > > Trond, any thoughts on the other oops that Nix posted? The issue there
> > > > seems to be that we're trying to do the pathwalk to the rpcbind unix
> > > > socket from exit_task_work(), but that's happening after we've already
> > > > called exit_fs().
> > > > 
> > > > The trivial answer seems to be to simply call exit_task_work() before
> > > > exit_fs() there, but it seems like we ought to be doing the upcall to
> > > > rpcbind in a mount namespace from which we know we can reach the
> > > > socket...
> > > 
> > > Isn't it enough to just do the same thing as we did for gss proxy? i.e.
> > > set the RPC_CLNT_CREATE_NO_IDLE_TIMEOUT flag.
> > > 
> > > See attachment.
> > 
> > Yeah, that looks like a reasonable thing to do...
> > 
> > OTOH, Is there any other way for a unix socket to end up disconnected
> > other than if we were to close it? Maybe if rpcbind stopped, the socket
> > unlinked and recreated and then started again?
> > 
> > If so then you still could potentially end up in this situation even if
> > you didn't autoclose it.
> 
> True. How about something like the following instead. Note the change to
> the original patch...

Looks good to me.

Acked-by: Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2013-08-06  9:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-04 15:40 Nix
2013-08-05 12:44 ` Jeff Layton
2013-08-05 14:48   ` Nix
2013-08-05 15:04     ` Jeff Layton
2013-08-05 15:11       ` Jeff Layton
2013-08-05 15:50         ` Nix
2013-08-05 16:15           ` Myklebust, Trond
2013-08-05 17:37             ` Jeff Layton
2013-08-05 18:18               ` Myklebust, Trond
2013-08-05 18:33                 ` Jeff Layton
2013-08-06  2:21                   ` Myklebust, Trond
2013-08-06  9:24                     ` Jeff Layton [this message]
2013-08-07 10:18                     ` Nix
2013-08-07 15:27                       ` Myklebust, Trond
2013-08-07 21:01                         ` Nix
2013-08-07 21:09                           ` Myklebust, Trond
2013-08-05 18:33             ` Nix
2013-08-05 19:12               ` Myklebust, Trond
2013-08-06 20:46                 ` Nix
2013-08-05 16:21           ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130806052406.40f7852f@tlielax.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=nix@esperi.org.uk \
    --cc=oleg@redhat.com \
    --cc=toralf.foerster@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®