]> granicus.if.org Git - postgresql/commitdiff
Mark FastPathStrongRelationLocks volatile.
authorRobert Haas <rhaas@postgresql.org>
Mon, 31 Mar 2014 18:32:12 +0000 (14:32 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 31 Mar 2014 18:32:12 +0000 (14:32 -0400)
Otherwise, the compiler might decide to move modifications to data
within this structure outside the enclosing SpinLockAcquire /
SpinLockRelease pair, leading to shared memory corruption.

This may or may not explain a recent lmgr-related buildfarm failure
on prairiedog, but it needs to be fixed either way.

src/backend/storage/lmgr/lock.c

index 6335129ac25e4856967177d01500080c4145cc3d..fd6cd0647ee195b6259fd71e8307caa9e96d4fcf 100644 (file)
@@ -238,7 +238,7 @@ typedef struct
        uint32          count[FAST_PATH_STRONG_LOCK_HASH_PARTITIONS];
 } FastPathStrongRelationLockData;
 
-static FastPathStrongRelationLockData *FastPathStrongRelationLocks;
+static volatile FastPathStrongRelationLockData *FastPathStrongRelationLocks;
 
 
 /*