From: Amir Goldstein <amir73il@gmail.com>
To: "Niklas Hambüchen" <mail@nh2.me>
Cc: Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>
Subject: Re: fsync() after close() and re-open -- insights appreciated
Date: Thu, 3 May 2018 16:28:07 +0300 [thread overview]
Message-ID: <CAOQ4uxjfABGG_nS+Jg7QqiW7YO0TL0rrGKqMyj-XKvg6vkc8hQ@mail.gmail.com> (raw)
In-Reply-To: <74319d6c-d429-9ea1-8f6d-ddb16834a796@nh2.me>
On Thu, May 3, 2018 at 3:30 PM, Niklas Hambüchen <mail@nh2.me> wrote:
> Hello,
>
> here's a simple question
> I'm having trouble finding answers to that is
> probably trivial to answer for file system developers.
>
Not trivial :)
Are you asking the question without being aware of all the discussions
that led to this patch https://lkml.org/lkml/2018/4/23/994
> Does a sequence of close()/re-open()/fsync() provide the same durability
> guarantees as fsync()/close()?
The short answer is no, the latter provides a better guaranty.
The longer answer is that durability guarantees depends on kernel version,
because situation has been changing in v4.13, v4.14 and now again in
v4.17-rc and stable kernels.
>
> http://pubs.opengroup.org/onlinepubs/009695399/functions/fsync.html
> specifies that
>
> "The fsync() function shall request that all data for the open file
> descriptor named by fildes is to be transferred to the storage device"
>
> which seems to restrict the statement to "for the open file descriptor",
> possibly suggesting that close()/open()/fsync() may not have the desired
> effect.
>
> Being able to link to an authorative answer would be very appreciated.
>
Sadly, there is no documentation at the level that you desire.
Thanks,
Amir.
next parent reply other threads:[~2018-05-03 13:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <74319d6c-d429-9ea1-8f6d-ddb16834a796@nh2.me>
2018-05-03 13:28 ` Amir Goldstein [this message]
2018-05-03 14:30 ` fsync() after close() and re-open -- insights appreciated Niklas Hambüchen
2018-05-03 19:58 ` Amir Goldstein
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=CAOQ4uxjfABGG_nS+Jg7QqiW7YO0TL0rrGKqMyj-XKvg6vkc8hQ@mail.gmail.com \
--to=amir73il@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mail@nh2.me \
/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;
as well as URLs for NNTP newsgroup(s).