From 4eabf66c32d097edaf3f442cefe707fec704efac Mon Sep 17 00:00:00 2001 From: Alexandros Batsakis Date: Wed, 20 Oct 2010 00:17:56 -0400 Subject: [PATCH] --- yaml --- r: 217187 b: refs/heads/master c: 9449925273933d19235d7d36c1fd970841d055de h: refs/heads/master i: 217185: 87e20da3231e067ec8b3b1e20100e9732bcac9a4 217183: 763f3c4ffd506bddf35ae27659a4df2e8d579465 v: v3 --- [refs] | 2 +- trunk/fs/nfs/callback_proc.c | 8 ++++---- trunk/include/linux/nfs4.h | 15 +++++++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 2a2cf3426510..062d5882282a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c772567d97fa0fca454eea68aeae915ca1bc732b +refs/heads/master: 9449925273933d19235d7d36c1fd970841d055de diff --git a/trunk/fs/nfs/callback_proc.c b/trunk/fs/nfs/callback_proc.c index 930d10fecdaf..2950fca0c61b 100644 --- a/trunk/fs/nfs/callback_proc.c +++ b/trunk/fs/nfs/callback_proc.c @@ -118,11 +118,11 @@ int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, const n if (delegation == NULL) return 0; - /* seqid is 4-bytes long */ - if (((u32 *) &stateid->data)[0] != 0) + if (stateid->stateid.seqid != 0) return 0; - if (memcmp(&delegation->stateid.data[4], &stateid->data[4], - sizeof(stateid->data)-4)) + if (memcmp(&delegation->stateid.stateid.other, + &stateid->stateid.other, + NFS4_STATEID_OTHER_SIZE)) return 0; return 1; diff --git a/trunk/include/linux/nfs4.h b/trunk/include/linux/nfs4.h index 6c0406e87d5c..34da32436ac0 100644 --- a/trunk/include/linux/nfs4.h +++ b/trunk/include/linux/nfs4.h @@ -17,7 +17,9 @@ #define NFS4_BITMAP_SIZE 2 #define NFS4_VERIFIER_SIZE 8 -#define NFS4_STATEID_SIZE 16 +#define NFS4_STATEID_SEQID_SIZE 4 +#define NFS4_STATEID_OTHER_SIZE 12 +#define NFS4_STATEID_SIZE (NFS4_STATEID_SEQID_SIZE + NFS4_STATEID_OTHER_SIZE) #define NFS4_FHSIZE 128 #define NFS4_MAXPATHLEN PATH_MAX #define NFS4_MAXNAMLEN NAME_MAX @@ -167,7 +169,16 @@ struct nfs4_acl { }; typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; -typedef struct { char data[NFS4_STATEID_SIZE]; } nfs4_stateid; + +struct nfs41_stateid { + __be32 seqid; + char other[NFS4_STATEID_OTHER_SIZE]; +} __attribute__ ((packed)); + +typedef union { + char data[NFS4_STATEID_SIZE]; + struct nfs41_stateid stateid; +} nfs4_stateid; enum nfs_opnum4 { OP_ACCESS = 3,