[PATCH 06/21] SQUASHME: nfsd41: simplify match_clientid_establishment logic

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

 



As per Bruce's review comment.

squash into "nfsd41: match clientid establishment method"

Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
---
 fs/nfsd/nfs4state.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 445cf94..6ae12ff 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -876,12 +876,17 @@ find_unconfirmed_client(clientid_t *clid)
  * Return 1 iff clp's clientid establishment method matches the use_exchange_id
  * parameter. Matching is based on the fact the at least one of the
  * EXCHGID4_FLAG_USE_{NON_PNFS,PNFS_MDS,PNFS_DS} flags must be set for v4.1
+ *
+ * FIXME: we need to unify the clientid namespaces for nfsv4.x
+ * and correctly deal with client upgrade/downgrade in EXCHANGE_ID
+ * and SET_CLIENTID{,_CONFIRM}
  */
 static inline int
 match_clientid_establishment(struct nfs4_client *clp, bool use_exchange_id)
 {
 #if defined(CONFIG_NFSD_V4_1)
-	return (clp->cl_exchange_flags != 0) == (use_exchange_id != false);
+	bool has_exchange_flags = (clp->cl_exchange_flags != 0);
+	return use_exchange_id == has_exchange_flags;
 #else  /* CONFIG_NFSD_V4_1 */
 	return 1;
 #endif /* CONFIG_NFSD_V4_1 */
-- 
1.6.2.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