Windows: lock protected fields must be 32-bit
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 16 May 2011 01:56:17 +0000 (21:56 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Wed, 18 May 2011 13:44:16 +0000 (06:44 -0700)
It is not safe to protect two 16-bit fields in a structure
with different locks.  Switch to using 32-bit fields.

Increment the cm-memmap version number since the data structure
sizes changed and the cache file must be invalidated.

Change-Id: I867b4b85b4fd9fe0083ad9d0559311f1c287513f
Reviewed-on: http://gerrit.openafs.org/4660
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_buf.h
src/WINNT/afsd/cm_memmap.h
src/WINNT/afsd/cm_volume.h

index 670cb94..13d2381 100644 (file)
@@ -62,8 +62,8 @@ typedef struct cm_buf {
     afs_uint32 dirtyCounter;   /* bumped at each dirty->clean transition */
     osi_hyper_t offset;                /* offset */
     cm_fid_t fid;              /* file ID */
-    afs_uint16 flags;          /* flags we're using - mx */
-    afs_uint16 qFlags;         /* queue/hash state flags - buf_globalLock */
+    afs_uint32 flags;          /* flags we're using - mx */
+    afs_uint32 qFlags;         /* queue/hash state flags - buf_globalLock */
     char *datap;               /* data in this buffer */
     afs_uint32 error;          /* last error code, if CM_BUF_ERROR is set */
     cm_user_t *userp;          /* user who wrote to the buffer last */
index 7df0341..a4b57b2 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef CM_MEMMAP_H
 #define CM_MEMMAP_H 1
 
-#define CM_CONFIG_DATA_VERSION  14
+#define CM_CONFIG_DATA_VERSION  15
 #define CM_CONFIG_DATA_MAGIC            ('A' | 'F'<<8 | 'S'<<16 | CM_CONFIG_DATA_VERSION<<24)
 
 typedef struct cm_config_data {
index 9d21ac9..6b5a97c 100644 (file)
@@ -24,8 +24,8 @@ typedef struct cm_vol_state {
     struct cm_fid dotdotFid;           /* parent of volume root */
     cm_serverRef_t *serversp;           /* by cm_serverLock */
     enum volstatus  state;              /* by rw */
-    afs_uint16      flags;              /* by rw */
-    afs_uint16      qflags;             /* by cm_volumeLock */
+    afs_uint32      flags;              /* by rw */
+    afs_uint32      qflags;             /* by cm_volumeLock */
 } cm_vol_state_t;
 
 /* RWVOL, ROVOL, BACKVOL are defined in cm.h */