postgres.git / summary / log / commit / refs
commit e980ec7c80713e645e08b74e126badb1ca5cecfa
Author: Robert Haas <rhaas@postgresql.org>
Date: Mon Mar 31 18:32:12 2014 +0000
First released in: 9.4.0, 9.2.9, 9.3.5
Mark FastPathStrongRelationLocks volatile.
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index b7a5e457448..3566208904c 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -237,7 +237,7 @@ typedef struct
uint32 count[FAST_PATH_STRONG_LOCK_HASH_PARTITIONS];
} FastPathStrongRelationLockData;
-FastPathStrongRelationLockData *FastPathStrongRelationLocks;
+volatile FastPathStrongRelationLockData *FastPathStrongRelationLocks;
/*
[parent: 6a63dda4c2a0]