]> granicus.if.org Git - postgresql/commitdiff
pg_test_fsync: add C comment about direct I/O and write size failure
authorBruce Momjian <bruce@momjian.us>
Wed, 12 Feb 2014 20:38:14 +0000 (15:38 -0500)
committerBruce Momjian <bruce@momjian.us>
Wed, 12 Feb 2014 20:38:29 +0000 (15:38 -0500)
Report from Marti Raudsepp

contrib/pg_test_fsync/pg_test_fsync.c

index 669c4190d38c342afaaa0e4480dfc374612d6063..682821a8d787392fc4fa9ffa99e00d2cb8b77067 100644 (file)
@@ -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");