linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@primarydata.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 4/4] SQUASHME: pnfsd: fixup error code for layout_commit
Date: Sun,  6 Oct 2013 10:44:36 +0300	[thread overview]
Message-ID: <1381045476-30766-1-git-send-email-bhalevy@primarydata.com> (raw)
In-Reply-To: <5251140B.4000203@primarydata.com>

Signed-off-by: Benny Halevy <bhalevy@primarydata.com>
---
 fs/nfsd/nfs4pnfsd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c
index a117a5d..e37a169 100644
--- a/fs/nfsd/nfs4pnfsd.c
+++ b/fs/nfsd/nfs4pnfsd.c
@@ -949,8 +949,12 @@ struct super_block *
 	nfserr = nfs4_process_layout_stateid(clp, &lcp->lc_sid,
 					     NFS4_LAYOUT_STID, &ls);
 	nfs4_unlock_state();
-	if (nfserr)
+	if (nfserr) {
+		/* fixup error code as per RFC5661 */
+		if (nfserr == nfserr_bad_stateid)
+			nfserr = nfserr_badlayout;
 		goto out;
+	}
 
 	if (sb->s_pnfs_op->layout_commit) {
 		struct nfs4_file *fp = ls->ls_file;
-- 
1.8.3.1


      parent reply	other threads:[~2013-10-06  7:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-06  7:40 [PATCH 0/4] pnfsd: refactor nfs4_process_layout_stateid Benny Halevy
2013-10-06  7:44 ` [PATCH 1/4] SQUASHME: fix lo_destroy_list nested definition Benny Halevy
2013-10-06  7:44 ` [PATCH 2/4] SQUASHME: pnfsd: nfs4_find_create_layout_stateid Benny Halevy
2013-10-06 15:29   ` Christoph Hellwig
2013-10-07 15:03     ` Benny Halevy
2013-10-07 15:45   ` [PATCH v2 " Benny Halevy
2013-10-06  7:44 ` [PATCH 3/4] SQUASHME: pnfsd: no need for find_file in layout commit/return Benny Halevy
2013-10-06 15:30   ` Christoph Hellwig
2013-10-07 15:50   ` [PATCH v2 " Benny Halevy
2013-10-06  7:44 ` Benny Halevy [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=1381045476-30766-1-git-send-email-bhalevy@primarydata.com \
    --to=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 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).