[PATCH v2 20/35] pnfsd: LAYOUTGET layout stateid processing

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

 



From: Andy Adamson <andros@xxxxxxxxxx>

[Moved pnfsd code from nfs4state.c to nfs4pnfsd.c]
Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
[pnfsd: clean up layoutget export API]
Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
---
 fs/nfsd/nfs4pnfsd.c |    5 +++++
 fs/nfsd/nfs4xdr.c   |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c
index a72fe19..9543e96 100644
--- a/fs/nfsd/nfs4pnfsd.c
+++ b/fs/nfsd/nfs4pnfsd.c
@@ -443,6 +443,11 @@ nfs4_pnfs_get_layout(struct nfsd4_pnfs_layoutget *lgp,
 	if (!fp || !clp)
 		goto out;
 
+	/* Check decoded layout stateid */
+	status = nfs4_process_layout_stateid(clp, fp, &lgp->lg_sid, &ls);
+	if (status)
+		goto out;
+
 	/* pre-alloc layout in case we can't merge after we call
 	 * the file system
 	 */
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 949e92d..2760564 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3369,7 +3369,7 @@ nfsd4_encode_layoutget(struct nfsd4_compoundres *resp,
 	if (xdr.end - xdr.p > exp_xdr_qwords(maxcount & ~3))
 		xdr.end = xdr.p + exp_xdr_qwords(maxcount & ~3);
 
-	/* Retrieve, encode, and merge layout */
+	/* Retrieve, encode, and merge layout; process stateid */
 	nfserr = nfs4_pnfs_get_layout(lgp, &xdr);
 	if (nfserr)
 		goto err;
-- 
1.6.5.1

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