public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* nfsd bugfixes for 2.6.35
@ 2010-06-09 19:12 J. Bruce Fields
  2010-06-10 13:45 ` Jeff Layton
  0 siblings, 1 reply; 2+ messages in thread
From: J. Bruce Fields @ 2010-06-09 19:12 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-nfs

These two nfsd bugfixes are suitable for 2.6.35:

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

Christoph Hellwig (1):
      nfsd: nfsd_setattr needs to call commit_metadata

J. Bruce Fields (2):
      nfsd4: shut down callback queue outside state lock
      Merge branch 'for-2.6.34-incoming' into for-2.6.35-incoming

commit 44b56603c4c476b845a824cff6fe905c6268b2a1
Merge: c3935e3 b160fda
Author: J. Bruce Fields <bfields@citi.umich.edu>
Date:   Tue Jun 8 20:05:18 2010 -0400

    Merge branch 'for-2.6.34-incoming' into for-2.6.35-incoming

commit c3935e30495869dd611e1cd62253c94ebc7c6c04
Author: J. Bruce Fields <bfields@citi.umich.edu>
Date:   Fri Jun 4 16:42:08 2010 -0400

    nfsd4: shut down callback queue outside state lock
    
    This reportedly causes a lockdep warning on nfsd shutdown.  That looks
    like a false positive to me, but there's no reason why this needs the
    state lock anyway.
    
    Reported-by: Jeff Layton <jlayton@redhat.com>
    Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 12f7109..4a27347 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4122,8 +4122,8 @@ nfs4_state_shutdown(void)
 	nfs4_lock_state();
 	nfs4_release_reclaim();
 	__nfs4_state_shutdown();
-	nfsd4_destroy_callback_queue();
 	nfs4_unlock_state();
+	nfsd4_destroy_callback_queue();
 }
 
 /*

commit b160fdabe93a8a53094f90f02bf4dcb500782aab
Author: Christoph Hellwig <hch@lst.de>
Date:   Tue Jun 1 21:59:18 2010 +0200

    nfsd: nfsd_setattr needs to call commit_metadata
    
    The conversion of write_inode_now calls to commit_metadata in commit
    f501912a35c02eadc55ca9396ece55fe36f785d0 missed out the call in nfsd_setattr.
    
    But without this conversion we can't guarantee that a SETATTR request
    has actually been commited to disk with XFS, which causes a regression
    from 2.6.32 (only for NFSv2, but anyway).
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Cc: stable@kernel.org
    Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 6dd5f19..3440dd8 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -443,8 +443,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
 	if (size_change)
 		put_write_access(inode);
 	if (!err)
-		if (EX_ISSYNC(fhp->fh_export))
-			write_inode_now(inode, 1);
+		commit_metadata(fhp);
 out:
 	return err;
 

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

* Re: nfsd bugfixes for 2.6.35
  2010-06-09 19:12 nfsd bugfixes for 2.6.35 J. Bruce Fields
@ 2010-06-10 13:45 ` Jeff Layton
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2010-06-10 13:45 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linus Torvalds, linux-nfs

On Wed, 9 Jun 2010 15:12:47 -0400
"J. Bruce Fields" <bfields@fieldses.org> wrote:

> These two nfsd bugfixes are suitable for 2.6.35:
> 
>   git://linux-nfs.org/~bfields/linux.git for-2.6.35
> 
> Christoph Hellwig (1):
>       nfsd: nfsd_setattr needs to call commit_metadata
> 
> J. Bruce Fields (2):
>       nfsd4: shut down callback queue outside state lock
>       Merge branch 'for-2.6.34-incoming' into for-2.6.35-incoming
> 
> commit 44b56603c4c476b845a824cff6fe905c6268b2a1
> Merge: c3935e3 b160fda
> Author: J. Bruce Fields <bfields@citi.umich.edu>
> Date:   Tue Jun 8 20:05:18 2010 -0400
> 
>     Merge branch 'for-2.6.34-incoming' into for-2.6.35-incoming
> 
> commit c3935e30495869dd611e1cd62253c94ebc7c6c04
> Author: J. Bruce Fields <bfields@citi.umich.edu>
> Date:   Fri Jun 4 16:42:08 2010 -0400
> 
>     nfsd4: shut down callback queue outside state lock
>     
>     This reportedly causes a lockdep warning on nfsd shutdown.  That looks
>     like a false positive to me, but there's no reason why this needs the
>     state lock anyway.
>     
>     Reported-by: Jeff Layton <jlayton@redhat.com>
>     Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
> 

FWIW, I figured out the reason for this yesterday...

When destroy_workqueue holds the cpu_add_remove_lock while it's
flushing the workqueue during shutdown. The laundry_wq job locks the
state during its work, so the locks are taken like this:

#0: cpu_add_remove_lock
#1: client_mutex

...after shutting down the laundry_wq, we go to shut down the
callback_wq. While doing that, we take and hold the client_mutex and
then call destroy_workqueue. Now we end up with the locks taken in the
reverse order and we get the lockdep splatter:

#0: client_mutex
#1: cpu_add_remove_lock

...moving the destroy of the callback_wq outside of the client_mutex
seems like the easiest and best fix.

-- 
Jeff Layton <jlayton@redhat.com>

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

end of thread, other threads:[~2010-06-10 13:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-09 19:12 nfsd bugfixes for 2.6.35 J. Bruce Fields
2010-06-10 13:45 ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox