All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Benny Halevy <bhalevy@primarydata.com>
Cc: bfields@redhat.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/7] nfsd4: fix recall_lock use in unhash_delegation
Date: Wed, 30 Oct 2013 18:19:59 -0400	[thread overview]
Message-ID: <20131030221958.GA24795@fieldses.org> (raw)
In-Reply-To: <52711AF7.4070100@primarydata.com>

On Wed, Oct 30, 2013 at 04:43:03PM +0200, Benny Halevy wrote:
> On 2013-10-30 16:35, J. Bruce Fields wrote:
> > On Wed, Oct 30, 2013 at 04:02:47PM +0200, Benny Halevy wrote:
> >> On 2013-10-29 16:46, J. Bruce Fields wrote:
> >>> On Tue, Oct 29, 2013 at 11:39:04AM +0200, Benny Halevy wrote:
> >>>> Access to dp->dl_perclnt must be synchronized by the recall_lock
> >>>
> >>> Are you sure?  recall_lock is for stuff that's needed in the delegation
> >>> break callback (nfsd_break_deleg_cb() and any of the subsequent callback
> >>> handling).  I don't think that includes dl_perclnt.
> >>
> >> I was mislead by the fact that destroy_client and nfs4_state_shutdown_net
> >> care to acquire the recall_lock for traversing the clp->cl_delegations
> >> and nn->del_recall_lru lists, respectively.
> >>
> >> Now nfs4_state_shutdown_net, although its comment says it should be
> >> called with the state lock held (SHOULD or should, or should it be MUST? :)
> >> It doesn't seem like nfsd_shutdown_net acquires the state lock.
> > 
> > Good point.
> > 
> >> Therefore, we either need to grab the state lock in nfs4_state_shutdown_net
> >> which adds yet another problem to fix,
> > 
> > That sounds simplest as the short-term fix....  What problem do you see?
> 
> Nothing specific, just the general use of the global state lock...
> 
> > 
> > --b.
> > 
> > commit 2c9407ae694dad8a1ad6394d9bf6077024b9fae7
> > Author: J. Bruce Fields <bfields@redhat.com>
> > Date:   Wed Oct 30 10:33:09 2013 -0400
> > 
> >     nfsd4: nfsd_shutdown_net needs state lock
> >     
> >     A comment claims the caller should take it, but that's not being done.
> >     Note we don't want it around the cancel_delayed_work_sync since that may
> >     wait on work which holds the client lock.
> >     
> >     Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> 
> Ack

Thanks, done, and pushed out to

	git://linux-nfs.org/~bfields/linux.git for-3.13

--b.

> 
> > 
> > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> > index 21eb678..e03e8ef 100644
> > --- a/fs/nfsd/nfs4state.c
> > +++ b/fs/nfsd/nfs4state.c
> > @@ -5124,7 +5124,6 @@ out_recovery:
> >  	return ret;
> >  }
> >  
> > -/* should be called with the state lock held */
> >  void
> >  nfs4_state_shutdown_net(struct net *net)
> >  {
> > @@ -5135,6 +5134,7 @@ nfs4_state_shutdown_net(struct net *net)
> >  	cancel_delayed_work_sync(&nn->laundromat_work);
> >  	locks_end_grace(&nn->nfsd4_manager);
> >  
> > +	nfs4_lock_state();
> >  	INIT_LIST_HEAD(&reaplist);
> >  	spin_lock(&recall_lock);
> >  	list_for_each_safe(pos, next, &nn->del_recall_lru) {
> > @@ -5149,6 +5149,7 @@ nfs4_state_shutdown_net(struct net *net)
> >  
> >  	nfsd4_client_tracking_exit(net);
> >  	nfs4_state_destroy_net(net);
> > +	nfs4_unlock_state();
> >  }
> >  
> >  void
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > 

  reply	other threads:[~2013-10-30 22:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29  9:37 [PATCH 0/7] delegation state fixes and cleanups for 3.13 Benny Halevy
2013-10-29  9:39 ` [PATCH 1/7] nfsd4: fix recall_lock use in unhash_delegation Benny Halevy
2013-10-29 14:46   ` J. Bruce Fields
2013-10-30 14:02     ` Benny Halevy
2013-10-30 14:35       ` J. Bruce Fields
2013-10-30 14:43         ` Benny Halevy
2013-10-30 22:19           ` J. Bruce Fields [this message]
2013-10-29  9:39 ` [PATCH 2/7] nfsd4: need to destroy revoked delegations in destroy_client Benny Halevy
2013-10-29 15:04   ` J. Bruce Fields
2013-10-29 16:02     ` J. Bruce Fields
2013-10-30 14:07       ` Benny Halevy
2013-10-29  9:39 ` [PATCH 3/7] nfsd4: properly hash delegation in nfs4_setlease Benny Halevy
2013-10-29  9:39 ` [PATCH 4/7] nfsd4: hash deleg stateid only on successful nfs4_set_delegation Benny Halevy
2013-10-29 15:54   ` J. Bruce Fields
2013-10-30 14:10     ` Benny Halevy
2013-10-29  9:39 ` [PATCH 5/7] nfsd4: cleanup hash and unhash delegation Benny Halevy
2013-10-29  9:39 ` [PATCH 6/7] nfsd4: move nfs4_put_file from unhash to put delegation Benny Halevy
2013-10-29 15:59   ` J. Bruce Fields
2013-10-30 14:16     ` Benny Halevy
2013-10-29  9:39 ` [PATCH 7/7] nfsd4: hold recall_lock while accessing nfs4_delegation.dl_recall_lru Benny Halevy
2013-10-29 16:06 ` [PATCH 0/7] delegation state fixes and cleanups for 3.13 J. Bruce Fields

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=20131030221958.GA24795@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=bfields@redhat.com \
    --cc=bhalevy@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 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.