mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michael Kerrisk" <mtk.manpages@googlemail.com>
To: "Pavel Machek" <pavel@suse.cz>
Cc: linux-doc@vger.kernel.org, "kernel list" <linux-kernel@vger.kernel.org>
Subject: Re: fsync.2 does not mention error handling
Date: Thu, 4 Dec 2008 14:12:11 -0500	[thread overview]
Message-ID: <cfd18e0f0812041112u23843f00rad92fba8badb43c6@mail.gmail.com> (raw)
In-Reply-To: <20081202120645.GA5327@elf.ucw.cz>

Pavel,

On Tue, Dec 2, 2008 at 7:06 AM, Pavel Machek <pavel@suse.cz> wrote:
>
> 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.

Could you provide some pointers to supporting information / mail
threads, relating to this?

Also, I'm still not 100% clear what you are saying above.  Do you mean
that in this scenario, an error may occur but the first caller above
won't know of it?  (It would help if you could write a few sentences
that you think should be in the man page.)

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html

  reply	other threads:[~2008-12-04 19:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 12:06 Pavel Machek
2008-12-04 19:12 ` Michael Kerrisk [this message]
2008-12-08 16:14   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cfd18e0f0812041112u23843f00rad92fba8badb43c6@mail.gmail.com \
    --to=mtk.manpages@googlemail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=pavel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®