[PATCH 3/3] SQUASHME: nfs41: Backchannel: Be more obvious about the return value

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

 



validate_seqid() returns the error value that will be encoded into the XDR
result. Change validate_seqid() to return be32 so that it's obvious that this
error is meant to be XDR encoded.

[squash with: nfs41: Backchannel: CB_SEQUENCE validation]

Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@xxxxxxxxxx>
---
 fs/nfs/callback_proc.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index c85d66f..95e9022 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -127,7 +127,7 @@ validate_seqid(struct nfs4_slot_table *tbl, u32 slotid, u32 seqid)
 		__func__, slotid, seqid);
 
 	if (slotid > NFS41_BC_MAX_CALLBACKS)
-		return NFS4ERR_BADSLOT;
+		return htonl(NFS4ERR_BADSLOT);
 
 	slot = tbl->slots + slotid;
 	dprintk("%s slot table seqid: %d\n", __func__, slot->seq_nr);
@@ -135,24 +135,24 @@ validate_seqid(struct nfs4_slot_table *tbl, u32 slotid, u32 seqid)
 	/* Normal */
 	if (likely(seqid == slot->seq_nr + 1)) {
 		slot->seq_nr++;
-		return NFS4_OK;
+		return htonl(NFS4_OK);
 	}
 
 	/* Replay */
 	if (seqid == slot->seq_nr) {
 		dprintk("%s seqid %d is a replay - no DRC available\n",
 			__func__, seqid);
-		return NFS4_OK;
+		return htonl(NFS4_OK);
 	}
 
 	/* Wraparound */
 	if (seqid == 1 && (slot->seq_nr + 1) == 0) {
 		slot->seq_nr = 1;
-		return NFS4_OK;
+		return htonl(NFS4_OK);
 	}
 
 	/* Misordered request */
-	return NFS4ERR_SEQ_MISORDERED;
+	return htonl(NFS4ERR_SEQ_MISORDERED);
 }
 
 /*
@@ -202,7 +202,7 @@ unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
 		kfree(args->csa_rclists[i].rcl_refcalls);
 	kfree(args->csa_rclists);
 
-	status = NFS4ERR_BADSESSION;
+	status = htonl(NFS4ERR_BADSESSION);
 	clp = find_client_with_session(args->csa_addr, 4, &args->csa_sessionid);
 	if (clp == NULL)
 		goto out;
@@ -223,7 +223,7 @@ out_putclient:
 	nfs_put_client(clp);
 out:
 	dprintk("%s: exit with status = %d\n", __func__, status);
-	res->csr_status = htonl(status);
+	res->csr_status = status;
 	return res->csr_status;
 }
 
-- 
1.5.4.3

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