Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f9bb944

Browse files
committed
pg_test_fsync: add C comment about direct I/O and write size failure
Report from Marti Raudsepp
1 parent 6f2aead commit f9bb944

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

contrib/pg_test_fsync/pg_test_fsync.c

+6
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,12 @@ test_sync(int writes_per_op)
369369
{
370370
for (writes = 0; writes < writes_per_op; writes++)
371371
if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
372+
/*
373+
* This can generate write failures if the filesystem
374+
* has a large block size, e.g. 4k, and there is no
375+
* support for O_DIRECT writes smaller than the
376+
* file system block size, e.g. XFS.
377+
*/
372378
die("write failed");
373379
if (lseek(tmpfile, 0, SEEK_SET) == -1)
374380
die("seek failed");

0 commit comments

Comments
 (0)