From: Andrew Morton <akpm@digeo.com>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: Nick Piggin <piggin@cyberone.com.au>,
lkml <linux-kernel@vger.kernel.org>,
ext3 users list <ext3-users@redhat.com>
Subject: Re: data corrupting bug in 2.4.20 ext3, data=journal
Date: Mon, 02 Dec 2002 09:45:04 -0800 [thread overview]
Message-ID: <3DEB9C20.9008C6E9@digeo.com> (raw)
In-Reply-To: 1038831305.1852.102.camel@sisko.scot.redhat.com
"Stephen C. Tweedie" wrote:
>
> ...
> The problem is that ext3 is expecting that truncate_inode_pages() (and
> hence ext3_flushpage) is only called during a truncate.
That's OK, because there shouldn't be any dirty data attached to the
inodes at that time. But there is, because the commit which write_super()
started hasn't finished yet:
static int do_sync_supers = 0;
...
target = log_start_commit(EXT3_SB(sb)->s_journal, NULL);
if (do_sync_supers) {
unlock_super(sb);
log_wait_commit(EXT3_SB(sb)->s_journal, target);
We need to do a full sync at unmount.
I assume that in other journalling modes the buffers are dirty
anyway, so sync_buffers() gets them.
And indeed enabling do_sync_supers fixes it up in both 2.4 and 2.5 (2.5
doesn't have sync_buffers(), but sync_inodes_sb() gets everything).
But are we sure that ->write_super() will always be called?
int fsync_super(struct super_block *sb)
{
...
if (sb->s_dirt && sb->s_op && sb->s_op->write_super)
sb->s_op->write_super(sb);
I suspect that if s_dirt is not set, and we have dirty inodes,
write_super is not called and nothing will force a commit anywhere
in the unmount process. Which could explain the similar failure
in 2.4.19-rc1 which Nick reports.
We need to be able to distinguish between a periodic flush of the
superblock and a real sync. The write_super overload has always
been uncomfortable.
Google for "write_super is not for syncing" ;) I think Chris's
patch is the way to fix all this up.
next prev parent reply other threads:[~2002-12-02 17:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-01 8:11 data corrupting bug in 2.4.20 ext3, data=journal Andrew Morton
2002-12-01 8:52 ` Andrew Morton
2002-12-01 12:41 ` Nick Piggin
2002-12-02 7:17 ` Andrew Morton
2002-12-02 12:15 ` Stephen C. Tweedie
2002-12-02 15:37 ` Stephen C. Tweedie
2002-12-02 17:45 ` Andrew Morton [this message]
2002-12-02 8:26 ` Nick Piggin
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=3DEB9C20.9008C6E9@digeo.com \
--to=akpm@digeo.com \
--cc=ext3-users@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=piggin@cyberone.com.au \
--cc=sct@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.