linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Kristian Nielsen <knielsen@knielsen-hq.org>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [ext3/4] PROBLEM: fdatasync not syncing appended data (w/test program)
Date: Mon, 3 Sep 2012 15:57:56 +0200	[thread overview]
Message-ID: <20120903135756.GI21109@quack.suse.cz> (raw)
In-Reply-To: <87k3wb8pgk.fsf@frigg.knielsen-hq.org>

On Mon 03-09-12 10:45:15, Kristian Nielsen wrote:
> It appears that ext3 and ext4 fdatasync() does not fully sync data to
> disk. Specifically, when new data is written at the end (so that the file
> length is increased), not all of the new data is synced by fdatasync().
> 
> It looks as if the problem is when the new data fits in the last allocated
> page for the file - then ext3/4 flushes the new data page to disk, but _not_
> the new metadata with the longer file size.
  Thanks for the detailed analysis. This is indeed a genuine bug. While
fixing some fsync issues I introduced (or better didn't fix) this problem.
The culprit is that we forget to update i_datasync_tid when we change only
inode size. Thus inode is not forced to disk during fdatasync(). I will send
fixes for this in a moment.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2012-09-03 13:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03  8:45 [ext3/4] PROBLEM: fdatasync not syncing appended data (w/test program) Kristian Nielsen
2012-09-03 13:57 ` Jan Kara [this message]
2012-09-04  6:07   ` Kristian Nielsen

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=20120903135756.GI21109@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=adilger.kernel@dilger.ca \
    --cc=knielsen@knielsen-hq.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@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).