linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Ian Kent <raven@themaw.net>
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: Umount and delegation release thread syncronization
Date: Mon, 25 Jul 2011 15:30:52 -0400	[thread overview]
Message-ID: <1311622252.28209.21.camel@lade.trondhjem.org> (raw)
In-Reply-To: <1310442708.25348.10.camel@perseus.themaw.net>

On Tue, 2011-07-12 at 11:51 +0800, Ian Kent wrote: 
> On Mon, 2011-06-20 at 15:45 +0800, Ian Kent wrote:
> > Hi all,
> > 
> > I'm having difficulty working out how delegation release threads are
> > synchronized with umount.
> > 
> > For an information about the problem please see
> > https://bugzilla.kernel.org/show_bug.cgi?id=30882 and in particular
> > comment #28.
> > 
> > Can someone please give me a description of the sequence of events at
> > umount (aka. nfs4_kill_super() function calls). In particular how does
> > nfs_free_server() know that if nfs_super_return_all_delegations() starts
> > a thread that it is finished before freeing the server struct.
> 
> No response in almost a month. everyone must be really busy.
> 
> But does no-one know how this works?
> 
> Trond, could you have a look at the above bug and offer your input
> please.

The only code that seems dubious there is the line

clp = NFS_SERVER(delegation->inode)->nfs_client;

Both the delegation and the nfs_client are guaranteed to still be around
whenever nfs_expire_unreferenced_delegations() is called: the RCU
protection of the clp->cl_superblock and server->delegations lists
ensures that.

However the delegation->inode is not guaranteed to still exist...

The obvious fix is to pass the struct nfs_server as a parameter to
nfs_mark_return_delegation() instead of trying to derive it from the
inode.

Cheers
  Trond

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com


      reply	other threads:[~2011-07-25 19:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-20  7:45 Umount and delegation release thread syncronization Ian Kent
2011-07-12  3:51 ` Ian Kent
2011-07-25 19:30   ` Trond Myklebust [this message]

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=1311622252.28209.21.camel@lade.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=raven@themaw.net \
    /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;
as well as URLs for NNTP newsgroup(s).