linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] NFSD: Re-initialize fh_post/pre_saved between two operations
@ 2014-03-26  9:12 Kinglong Mee
  2014-03-28 21:19 ` J. Bruce Fields
  0 siblings, 1 reply; 6+ messages in thread
From: Kinglong Mee @ 2014-03-26  9:12 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

Testing NFS4.0 by pynfs, I got some messeages as,
"nfsd: inode locked twice during operation."

When one compound RPC contains two or more SETATTR operation
for one filehandle,the second SETATTR will cause the message.

Because after the first SETATTR, nfsd will not call fh_put()
to release current filehandle, it means filehandle have unlocked
with fh_post_saved = 1.
The second SETATTR find fh_post_saved = 1, and printk the message.

This patch re-initialize fh_post/pre_saved between two operations.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfsd/nfs4proc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 550faf2..103d1ac 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1356,6 +1356,9 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
 			  !(opdesc->op_flags & ALLOWED_ON_ABSENT_FS)) {
 			op->status = nfserr_moved;
 			goto encode_op;
+		} else {
+			current_fh->fh_post_saved = 0;
+			current_fh->fh_pre_saved = 0;
 		}

 		/* If op is non-idempotent */
-- 
1.8.5.3


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

end of thread, other threads:[~2014-03-29 19:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-26  9:12 [PATCH 2/2] NFSD: Re-initialize fh_post/pre_saved between two operations Kinglong Mee
2014-03-28 21:19 ` J. Bruce Fields
2014-03-28 22:41   ` Kinglong Mee
2014-03-29  0:58     ` J. Bruce Fields
2014-03-29  2:23       ` [PATCH v2] NFSD: Clear wcc data between compound ops Kinglong Mee
2014-03-29 19:46         ` J. Bruce Fields

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).