mirror of
https://github.com/postgres/postgres.git
synced 2025-07-21 16:02:15 +03:00
pg_test_fsync: add C comment about direct I/O and write size failure
Report from Marti Raudsepp
This commit is contained in:
@ -369,6 +369,12 @@ test_sync(int writes_per_op)
|
|||||||
{
|
{
|
||||||
for (writes = 0; writes < writes_per_op; writes++)
|
for (writes = 0; writes < writes_per_op; writes++)
|
||||||
if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
|
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");
|
die("write failed");
|
||||||
if (lseek(tmpfile, 0, SEEK_SET) == -1)
|
if (lseek(tmpfile, 0, SEEK_SET) == -1)
|
||||||
die("seek failed");
|
die("seek failed");
|
||||||
|
Reference in New Issue
Block a user