mirror of
https://github.com/postgres/postgres.git
synced 2026-10-28 02:33:10 +03:00
Silence Coverity warning about unused visibilitymap_clear() result
Commit c0d9864f5c made all but one caller of visibilitymap_clear() check
its return value, causing Coverity to flag the remaining unchecked call
in heap_page_fix_vm_corruption().
This VM clear is not WAL-logged, so the caller doesn't need the return
value of visibilitymap_clear(). Add an explicit void cast and comment to
document that the return value is intentionally ignored.
Backpatch to 19 when the number of callers discarding the return value
dropped low enough to trigger Coverity's warning.
Discussion: https://postgr.es/m/1065814.1784514869%40sss.pgh.pa.us
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 19
This commit is contained in:
@@ -948,9 +948,10 @@ heap_page_fix_vm_corruption(PruneState *prstate, OffsetNumber offnum,
|
||||
if (do_clear_vm)
|
||||
{
|
||||
LockBuffer(prstate->vmbuffer, BUFFER_LOCK_EXCLUSIVE);
|
||||
visibilitymap_clear(prstate->relation->rd_locator, prstate->block,
|
||||
prstate->vmbuffer,
|
||||
VISIBILITYMAP_VALID_BITS);
|
||||
/* This VM clear is not WAL-logged, so its return value is not needed. */
|
||||
(void) visibilitymap_clear(prstate->relation->rd_locator,
|
||||
prstate->block, prstate->vmbuffer,
|
||||
VISIBILITYMAP_VALID_BITS);
|
||||
LockBuffer(prstate->vmbuffer, BUFFER_LOCK_UNLOCK);
|
||||
prstate->old_vmbits = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user