[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081202120645.GA5327@elf.ucw.cz>
Date: Tue, 2 Dec 2008 13:06:46 +0100
From: Pavel Machek <pavel@...e.cz>
To: mtk.manpages@...il.com, linux-doc@...r.kernel.org,
kernel list <linux-kernel@...r.kernel.org>
Subject: fsync.2 does not mention error handling
fsync() transfers ("flushes") all modified in-core data of (i.e.,
modified buffer cache pages for) the file referred to by the file
descriptor fd to the disk device (or other permanent storage device)
where that file resides. The call blocks until the device reports
that the transfer has completed. It also flushes metadata information
associated with the file (see stat(2)).
Calling fsync() does not necessarily ensure that the entry in the
directory containing the file has also reached disk. For that an
explicit fsync() on a file descriptor for the directory is also
needed.
...
RETURN VALUE top
On success, these system calls return zero. On error, -1 is
returned, and errno is set appropriately.
--------------
I guess it should mention that any errors during fsync are only
mentioned to the first process calling it... which means that if you
write file
fsync file
fsync .
... and someone else does "fsync ." in the meantime, you may get
success when in fact directory entry of file is not written to the
disk.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists