Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6ca7cd8

Browse files
Assert that buffer is pinned in LockBuffer().
Strengthen the LockBuffer() assertion that verifies BufferIsValid() bymaking it verify BufferIsPinned() instead. Do the same in nearbyrelated functions.There is probably not much chance that anybody will try to lock a bufferthat is not already pinned, but we might as well make sure of that.
1 parent0fa0b48 commit6ca7cd8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/storage/buffer/bufmgr.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3743,7 +3743,7 @@ LockBuffer(Buffer buffer, int mode)
37433743
{
37443744
BufferDesc*buf;
37453745

3746-
Assert(BufferIsValid(buffer));
3746+
Assert(BufferIsPinned(buffer));
37473747
if (BufferIsLocal(buffer))
37483748
return;/* local buffers need no lock */
37493749

@@ -3769,7 +3769,7 @@ ConditionalLockBuffer(Buffer buffer)
37693769
{
37703770
BufferDesc*buf;
37713771

3772-
Assert(BufferIsValid(buffer));
3772+
Assert(BufferIsPinned(buffer));
37733773
if (BufferIsLocal(buffer))
37743774
return true;/* act as though we got it */
37753775

@@ -3801,7 +3801,7 @@ LockBufferForCleanup(Buffer buffer)
38013801
BufferDesc*bufHdr;
38023802
char*new_status=NULL;
38033803

3804-
Assert(BufferIsValid(buffer));
3804+
Assert(BufferIsPinned(buffer));
38053805
Assert(PinCountWaitBuf==NULL);
38063806

38073807
if (BufferIsLocal(buffer))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp