public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Kleikamp <shaggy@austin.ibm.com>
To: blp@cs.stanford.edu
Cc: JFS Discussion <jfs-discussion@lists.sourceforge.net>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	mc@cs.stanford.edu
Subject: Re: [CHECKER] writes not always synchronous on JFS with O_SYNC?
Date: Tue, 22 Mar 2005 07:43:12 -0600	[thread overview]
Message-ID: <1111498992.8107.5.camel@localhost> (raw)
In-Reply-To: <87vf7kr9gs.fsf@benpfaff.org>

On Mon, 2005-03-21 at 13:10 -0800, Ben Pfaff wrote:
> Hi.  We've been running some tests on JFS and other file systems
> and believe we've found an issue whereby O_SYNC does not always
> cause data to be committed synchronously.  On Linux 2.6.11, we
> found that the program appended below causes
> /mnt/sbd0/0006/0010/0029/0033 to contain all zeros, despite the
> use of O_SYNC on the write calls and the fsyncs on the
> directories.  It seems to be pretty sensitive to the existence of
> the rmdir calls: if I omit one of them, the data does get
> written.

I can reproduce this behavior, but what I'm seeing is a little more
alarming than the data being written asynchronously.  After fsck replays
the journal, the xtree for the file is corrupt, which is why it appears
to contain zeros.  The syslog is showing that a corrupted xtree has been
found.  I am still investigating.

> Note that /dev/sbd0 is essentially a ramdisk that we've developed
> for testing this kind of thing: it allows a snapshot of a disk's
> momentary contents to be copied out, so that we don't have to do
> a reboot.

I'm getting similar results writing to a regular disk partition and
rebooting.

> Can you confirm this?

Confirmed.

> 	ret = test_creat("/mnt/sbd0/0006/0028", 511);

test_creat is type void.

> 	CHECK(ret);
> 	ret = test_write("/mnt/sbd0/0006/0028", 0);
> 	CHECK(ret);
> 	ret = mkdir("/mnt/sbd0/0006/0010/0029", 511);
> 	CHECK(ret);
> 	ret = test_creat("/mnt/sbd0/0006/0010/0029/0033", 511);
> 	CHECK(ret);
> 	ret = test_write("/mnt/sbd0/0006/0010/0029/0033", 0);
> 	CHECK(ret);
> 	ret = test_fsync("/mnt/sbd0/0006/0010/0029");

so is test_fsync

> 	CHECK(ret);

-- 
David Kleikamp
IBM Linux Technology Center


  reply	other threads:[~2005-03-22 13:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-21 21:10 [CHECKER] writes not always synchronous on JFS with O_SYNC? Ben Pfaff
2005-03-22 13:43 ` Dave Kleikamp [this message]
2005-03-22 19:41   ` Dave Kleikamp
2005-03-22 19:47     ` Ben Pfaff

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=1111498992.8107.5.camel@localhost \
    --to=shaggy@austin.ibm.com \
    --cc=blp@cs.stanford.edu \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mc@cs.stanford.edu \
    /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