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

Lines changed: 6 additions & 0 deletions
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)
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