diff mbox

[4/4] SQUASHME: pnfsd: fixup error code for layout_commit

Message ID 1381045476-30766-1-git-send-email-bhalevy@primarydata.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benny Halevy Oct. 6, 2013, 7:44 a.m. UTC
Signed-off-by: Benny Halevy <bhalevy@primarydata.com>
---
 fs/nfsd/nfs4pnfsd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

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;