[3.5.y.z,extended,stable] Patch "nfsd: don't run get_file if nfs4_preprocess_stateid_op return" has been added to staging queue

Message ID 1368613921-22606-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques May 15, 2013, 10:32 a.m.
This is a note to let you know that I have just added a patch titled

    nfsd: don't run get_file if nfs4_preprocess_stateid_op return

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From 1f66adc1970379ff0402b923464bc272fac7d90c Mon Sep 17 00:00:00 2001
From: fanchaoting <fanchaoting@cn.fujitsu.com>
Date: Mon, 1 Apr 2013 21:07:22 +0800
Subject: [PATCH] nfsd: don't run get_file if nfs4_preprocess_stateid_op return

commit b022032e195ffca83d7002d6b84297d796ed443b upstream.

we should return error status directly when nfs4_preprocess_stateid_op
return error.

Signed-off-by: fanchaoting <fanchaoting@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
[ luis: adjust context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
 fs/nfsd/nfs4proc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)



diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index dd0308d..7e97d93 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -893,14 +893,14 @@  nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,

 	status = nfs4_preprocess_stateid_op(cstate, stateid, WR_STATE, &filp);
-	if (filp)
-		get_file(filp);
-	nfs4_unlock_state();
 	if (status) {
+		nfs4_unlock_state();
 		dprintk("NFSD: nfsd4_write: couldn't process stateid!\n");
 		return status;
+	if (filp)
+		get_file(filp);
+	nfs4_unlock_state();

 	cnt = write->wr_buflen;
 	write->wr_how_written = write->wr_stable_how;