Skip to content

Commit 0ffe17a

Browse files
committed
lmgr.c didn't check for failure return from LockAcquire(). Boo hiss.
1 parent b982c3b commit 0ffe17a

File tree

1 file changed

+10
-5
lines changed
  • src/backend/storage/lmgr

1 file changed

+10
-5
lines changed

src/backend/storage/lmgr/lmgr.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.36 1999/11/17 23:51:21 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.37 1999/11/28 01:58:08 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -144,7 +144,8 @@ LockRelation(Relation relation, LOCKMODE lockmode)
144144
tag.dbId = relation->rd_lockInfo.lockRelId.dbId;
145145
tag.objId.blkno = InvalidBlockNumber;
146146

147-
LockAcquire(LockTableId, &tag, lockmode);
147+
if (! LockAcquire(LockTableId, &tag, lockmode))
148+
elog(ERROR, "LockRelation: LockAcquire failed");
148149

149150
/*
150151
* Check to see if the relcache entry has been invalidated
@@ -192,7 +193,8 @@ LockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode)
192193
tag.dbId = relation->rd_lockInfo.lockRelId.dbId;
193194
tag.objId.blkno = blkno;
194195

195-
LockAcquire(LockTableId, &tag, lockmode);
196+
if (! LockAcquire(LockTableId, &tag, lockmode))
197+
elog(ERROR, "LockPage: LockAcquire failed");
196198
}
197199

198200
/*
@@ -227,7 +229,8 @@ XactLockTableInsert(TransactionId xid)
227229
tag.dbId = InvalidOid;
228230
tag.objId.xid = xid;
229231

230-
LockAcquire(LockTableId, &tag, ExclusiveLock);
232+
if (! LockAcquire(LockTableId, &tag, ExclusiveLock))
233+
elog(ERROR, "XactLockTableInsert: LockAcquire failed");
231234
}
232235

233236
void
@@ -259,7 +262,9 @@ XactLockTableWait(TransactionId xid)
259262
tag.dbId = InvalidOid;
260263
tag.objId.xid = xid;
261264

262-
LockAcquire(LockTableId, &tag, ShareLock);
265+
if (! LockAcquire(LockTableId, &tag, ShareLock))
266+
elog(ERROR, "XactLockTableWait: LockAcquire failed");
267+
263268
LockRelease(LockTableId, &tag, ShareLock);
264269

265270
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy