diff options
author | Bruce Momjian <bruce@momjian.us> | 2014-02-12 15:38:14 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2014-02-12 15:38:29 -0500 |
commit | f9bb944cd879949cf454b941f2b8fa7b00fcc1e4 (patch) | |
tree | 5633bfaffeb2e3de6f0eda52f9eebcc85c242c1c | |
parent | 6f2aead1ffec6f056dc3c371c2ec6a12d7d5ccd3 (diff) |
pg_test_fsync: add C comment about direct I/O and write size failure
Report from Marti Raudsepp
-rw-r--r-- | contrib/pg_test_fsync/pg_test_fsync.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/pg_test_fsync/pg_test_fsync.c b/contrib/pg_test_fsync/pg_test_fsync.c index 669c4190d38..682821a8d78 100644 --- a/contrib/pg_test_fsync/pg_test_fsync.c +++ b/contrib/pg_test_fsync/pg_test_fsync.c @@ -369,6 +369,12 @@ test_sync(int writes_per_op) { for (writes = 0; writes < writes_per_op; writes++) if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ) + /* + * This can generate write failures if the filesystem + * has a large block size, e.g. 4k, and there is no + * support for O_DIRECT writes smaller than the + * file system block size, e.g. XFS. + */ die("write failed"); if (lseek(tmpfile, 0, SEEK_SET) == -1) die("seek failed"); |