LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: ajones@riverbed.com, sandeen@redhat.com,
linux-ext4@vger.kernel.org, sct@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext3: wait on all pending commits in ext3_sync_fs
Date: Mon, 3 Nov 2008 17:55:44 -0500 [thread overview]
Message-ID: <20081103225544.GH18117@mit.edu> (raw)
In-Reply-To: <20081103142706.92e3a2ae.akpm@linux-foundation.org>
On Mon, Nov 03, 2008 at 02:27:06PM -0800, Andrew Morton wrote:
> It should clear s_dirt before doing the "i/o", methinks?
Yep, good point. As I mentioned earlier, though, I'm about 99% sure
that the right fix is to remove all mention of s_dirt entirely, and in
fact we can make super_operations.write_super be NULL for ext3 and
ext4. But for now we should just keep it in its usual place for now,
and save that for a cleanup commit later on.
- Ted
commit b20506dc713db1105287b691390563d2aace6d84
Author: Theodore Ts'o <tytso@mit.edu>
Date: Mon Nov 3 17:54:41 2008 -0500
ext4: wait on all pending commits in ext4_sync_fs()
In ext4_sync_fs, we only wait for a commit to finish if we started it,
but there may be one already in progress which will not be synced.
In the case of a data=ordered umount with pending long symlinks which
are delayed due to a long list of other I/O on the backing block
device, this causes the buffer associated with the long symlinks to
not be moved to the inode dirty list in the second phase of
fsync_super. Then, before they can be dirtied again, kjournald exits,
seeing the UMOUNT flag and the dirty pages are never written to the
backing block device, causing long symlink corruption and exposing new
or previously freed block data to userspace.
To ensure all commits are synced, we flush all journal commits now
when sync_fs'ing ext4.
Signed-off-by: Arthur Jones <ajones@riverbed.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Eric Sandeen <sandeen@redhat.com>
Cc: <linux-ext4@vger.kernel.org>
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 97cb896..5b5e38e 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2907,12 +2907,9 @@ int ext4_force_commit(struct super_block *sb)
/*
* Ext4 always journals updates to the superblock itself, so we don't
* have to propagate any other updates to the superblock on disk at this
- * point. Just start an async writeback to get the buffers on their way
- * to the disk.
- *
- * This implicitly triggers the writebehind on sync().
+ * point. (We can probably nuke this function altogether, and remove
+ * any mention to sb->s_dirt in all of fs/ext4; eventual cleanup...)
*/
-
static void ext4_write_super(struct super_block *sb)
{
if (mutex_trylock(&sb->s_lock) != 0)
@@ -2922,15 +2919,15 @@ static void ext4_write_super(struct super_block *sb)
static int ext4_sync_fs(struct super_block *sb, int wait)
{
- tid_t target;
+ int ret;
trace_mark(ext4_sync_fs, "dev %s wait %d", sb->s_id, wait);
sb->s_dirt = 0;
- if (jbd2_journal_start_commit(EXT4_SB(sb)->s_journal, &target)) {
- if (wait)
- jbd2_log_wait_commit(EXT4_SB(sb)->s_journal, target);
- }
- return 0;
+ if (wait)
+ ret = ext4_force_commit(sb);
+ else
+ ret = jbd2_journal_start_commit(EXT4_SB(sb)->s_journal, NULL);
+ return ret;
}
/*
next prev parent reply other threads:[~2008-11-03 22:56 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081024183733.GA25797@ajones-laptop.nbttech.com>
2008-10-27 16:54 ` ext3: slow symlink corruption on umount Arthur Jones
2008-10-29 19:54 ` Arthur Jones
2008-10-29 20:36 ` Eric Sandeen
2008-10-29 21:09 ` Theodore Tso
2008-10-30 13:38 ` Eric Sandeen
2008-10-30 13:55 ` Arthur Jones
2008-10-31 9:47 ` Nick Piggin
2008-10-30 17:40 ` Arthur Jones
2008-10-30 18:03 ` Eric Sandeen
2008-10-30 21:34 ` Arthur Jones
2008-10-31 17:24 ` Arthur Jones
2008-10-31 18:37 ` Eric Sandeen
2008-10-30 18:32 ` Arthur Jones
2008-11-03 18:44 ` [PATCH] ext3: wait on all pending commits in ext3_sync_fs Arthur Jones
2008-11-03 19:33 ` Andrew Morton
2008-11-03 20:14 ` Arthur Jones
2008-11-03 20:37 ` Andrew Morton
2008-11-03 20:58 ` Arthur Jones
2008-11-03 21:13 ` Andrew Morton
2008-11-03 21:19 ` Theodore Tso
2008-11-03 21:27 ` Andrew Morton
2008-11-03 21:48 ` Theodore Tso
2008-11-03 22:01 ` Theodore Tso
2008-11-03 22:18 ` Arthur Jones
2008-11-03 22:27 ` Andrew Morton
2008-11-03 22:55 ` Theodore Tso [this message]
2008-11-03 23:01 ` Arthur Jones
2008-11-03 23:12 ` Theodore Tso
2008-11-04 16:26 ` Arthur Jones
2008-11-03 21:48 ` Arthur Jones
2008-11-03 22:47 ` Theodore Tso
2008-12-18 23:17 ` Jan Kara
2008-12-18 23:37 ` Eric Sandeen
2008-12-19 0:27 ` Jan Kara
2008-12-19 1:34 ` Eric Sandeen
2008-12-22 19:15 ` Ric Wheeler
2008-12-22 22:57 ` Andreas Dilger
2008-12-23 0:09 ` Ric Wheeler
2008-12-23 15:56 ` Eric Sandeen
2009-01-12 22:28 ` Jan Kara
2009-01-13 17:21 ` Eric Sandeen
2009-01-13 22:14 ` Eric Sandeen
2009-01-14 4:24 ` Theodore Tso
2009-01-14 17:26 ` Eric Sandeen
2009-01-14 17:27 ` Jan Kara
2009-01-29 18:27 ` Mike Snitzer
2009-01-29 20:05 ` Eric Sandeen
2008-11-03 19:59 ` Eric Sandeen
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=20081103225544.GH18117@mit.edu \
--to=tytso@mit.edu \
--cc=ajones@riverbed.com \
--cc=akpm@linux-foundation.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=sct@redhat.com \
--subject='Re: [PATCH] ext3: wait on all pending commits in ext3_sync_fs' \
/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
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).