Skip to content

Commit 10eae82

Browse files
committed
Fix thinko in assertion in basebackup.c.
Commit 5a1007a tried to introduce an assertion that the block size was at least twice the size of a tar block, but I got the math wrong. My error was reported to me off-list.
1 parent a27048c commit 10eae82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/replication/basebackup.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ perform_base_backup(basebackup_options *opt, bbsink *sink)
376376
else
377377
{
378378
/* Properly terminate the tarfile. */
379-
StaticAssertStmt(TAR_BLOCK_SIZE <= 2 * BLCKSZ,
379+
StaticAssertStmt(2 * TAR_BLOCK_SIZE <= BLCKSZ,
380380
"BLCKSZ too small for 2 tar blocks");
381381
memset(sink->bbs_buffer, 0, 2 * TAR_BLOCK_SIZE);
382382
bbsink_archive_contents(sink, 2 * TAR_BLOCK_SIZE);
@@ -621,7 +621,7 @@ perform_base_backup(basebackup_options *opt, bbsink *sink)
621621
}
622622

623623
/* Properly terminate the tar file. */
624-
StaticAssertStmt(TAR_BLOCK_SIZE <= 2 * BLCKSZ,
624+
StaticAssertStmt(2 * TAR_BLOCK_SIZE <= BLCKSZ,
625625
"BLCKSZ too small for 2 tar blocks");
626626
memset(sink->bbs_buffer, 0, 2 * TAR_BLOCK_SIZE);
627627
bbsink_archive_contents(sink, 2 * TAR_BLOCK_SIZE);

0 commit comments

Comments
 (0)