From: bugzilla-daemon@bugzilla.kernel.org
To: linux-ext4@vger.kernel.org
Subject: [Bug 70121] Increasing efficiency of full data journaling
Date: Fri, 07 Mar 2014 13:48:49 +0000 [thread overview]
Message-ID: <bug-70121-13602-6qocIAkhML@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-70121-13602@https.bugzilla.kernel.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=70121
--- Comment #7 from Theodore Tso <tytso@mit.edu> ---
On Fri, Mar 07, 2014 at 07:16:40AM +0000, bugzilla-daemon@bugzilla.kernel.org
wrote:
> > How does the file system know that the file has "successfully been
> > written"? Secondly, even if we did know, in order to guarantee the
> > transaction semantics, we *always* update the journal first. Only
> > after the journals is updated, do we write back to the final location
> > on disk. So what you are suggesting just simply wouldn't work.
>
> It seems it is just a too major change. Maybe it is something that could be
> considered in ext5.
If you think it can be done, plesae submit patches. :-)
> > it just
> > makes it more likely, but if you crash at the wrong moment, you can
> > still lose data
>
>
> I have never seen a damaged file with full data journaling enabled. Can you
> show me a race condition so that I can reproduce it? Hm, maybe it would be
> possible if the journal is smaller than the file (I'm wondering what would
> happen in such a case).
If the application is in the middle of writing the file when the
journal is committing, the file can be half written at the point where
the system is rebooted. If you are thinking about the case where the
application writes to a temp file, and then renames the temp file on
top of the pre-existing file (without first fsync'ing the temp file,
which is the application bug), then yes, data journalling will save
you from that one particular use case, but it will come at a cost.
(And if you crash while you are writing the temp file, of course you
do lose your pending changes.) You can get the same level of
protection by using mount -o nodelalloc instead of mount -o
data=journal.
As I said before, you'll give up some performance, but it won't be as
bad as using data=journal --- and you should still file bug reports
with your applications so they use fsync() properly. I'll note that
if they don't, you'll have problems with all other file systems,
whether they be xfs, btrfs, etc. Fsync(2) is the *only* way you can
guarantee that the contents of a file which has been written is safely
on stable store.
- Ted
--
You are receiving this mail because:
You are watching the assignee of the bug.
next prev parent reply other threads:[~2014-03-07 13:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 10:38 [Bug 70121] New: Increasing efficiency of full data journaling bugzilla-daemon
2014-02-07 11:28 ` [Bug 70121] " bugzilla-daemon
2014-02-07 14:49 ` bugzilla-daemon
2014-03-05 20:37 ` [Bug 70121] New: " Phillip Susi
2014-03-05 21:48 ` [Bug 70121] " bugzilla-daemon
2014-03-06 5:28 ` bugzilla-daemon
2014-03-07 20:41 ` Phillip Susi
2014-03-06 15:34 ` bugzilla-daemon
2014-03-07 7:16 ` bugzilla-daemon
2014-03-07 13:48 ` Theodore Ts'o
2014-03-07 13:48 ` bugzilla-daemon [this message]
2014-03-07 15:42 ` bugzilla-daemon
2014-03-07 20:41 ` bugzilla-daemon
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=bug-70121-13602-6qocIAkhML@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@bugzilla.kernel.org \
--cc=linux-ext4@vger.kernel.org \
/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).