[PATCH 1/6] pnfsd: fix file system API layout_get error codes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andy Adamson <andros@xxxxxxxxxx>

Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
---
 fs/nfsd/nfs4pnfsd.c |   36 ++++++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c
index 816e2f0..75bddd8 100644
--- a/fs/nfsd/nfs4pnfsd.c
+++ b/fs/nfsd/nfs4pnfsd.c
@@ -868,23 +868,31 @@ nfs4_pnfs_get_layout(struct nfsd4_pnfs_layoutget *lgp,
 		res.lg_seg.offset, res.lg_seg.length);
 
 	if (status) {
+		/*
+		 * The allowable error codes for the layout_get pNFS export
+		 * operations vector function (from the file system) can be
+		 * expanded as needed to include other errors defined for
+		 * the RFC 5561 LAYOUTGET operation.
+		 */
 		switch (status) {
-		case -ETOOSMALL:
-			status = nfserr_toosmall;
-			break;
-		case -ENOMEM:
-		case -EAGAIN:
-		case -EINTR:
-			status = nfserr_layouttrylater;
-			break;
-		case -ENOENT:
-			status = nfserr_badlayout;
-			break;
-		case -E2BIG:
-			status = nfserr_toosmall;
+		case nfserr_acces:
+		case nfserr_badiomode:
+			/* No support for LAYOUTIOMODE4_RW layouts */
+		case nfserr_badlayout:
+			/* No layout matching loga_minlength rules */
+		case nfserr_inval:
+		case nfserr_io:
+		case nfserr_layouttrylater:
+		case nfserr_layoutunavailable:
+		case nfserr_locked:
+		case nfserr_nospc:
+		case nfserr_recallconflict:
+		case nfserr_serverfault:
+		case nfserr_toosmall:
+			/* Requested layout to big for loga_maxcount */
 			break;
 		default:
-			status = nfserr_layoutunavailable;
+			BUG();
 		}
 		goto out_freelayout;
 	}
-- 
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux