diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2005-09-06 18:19:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:54 -0400 |
commit | cbf0d27a131639f4f3e4faa94373c5c6f89f8f07 (patch) | |
tree | 327deb90d3e77bf65189ff41c6121e2e865537ea | |
parent | 3870ee8c63d5e55aea990654dfeb231264e13134 (diff) |
[PATCH] kjournald: missing JFS_UNMOUNT check
It seems that kjournald() may be missing a check of the JFS_UNMOUNT flag
before calling schedule(). This showed up in testing of OCFS2 recovery
where our recovery thread would hang in journal_kill_thread() called from
journal_destroy() because kjournald never got a chance to read the flag to
shut down before the schedule().
Zach pointed out the missing check which led me to hack up this trivial
patch. It's been tested many times now and I have yet to reproduce the
hang, which was happening very regularly before.
<mild rant>
I'm guessing that we could really use some wait_event() calls with helper
functions in, well, most of jbd these days which would make a ton of the
wait code there vastly cleaner.
</mild rant>
As for why this doesn't happen in ext3 (or OCFS2 during normal
mount/unmount of the local nodes journal), I think it may that the specific
timing of events in the ocfs2 recovery thread exposes a race there.
Because ocfs2_replay_journal() is only interested in playing back the
journal, initialization and shutdown happen very quicky with no other
metadata put into that specific journal.
Acked-by: "Stephen C. Tweedie" <sct@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/jbd/journal.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index 71cfe25d716e..334f4cf0823b 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
@@ -179,6 +179,8 @@ loop: | |||
179 | if (transaction && time_after_eq(jiffies, | 179 | if (transaction && time_after_eq(jiffies, |
180 | transaction->t_expires)) | 180 | transaction->t_expires)) |
181 | should_sleep = 0; | 181 | should_sleep = 0; |
182 | if (journal->j_flags & JFS_UNMOUNT) | ||
183 | should_sleep = 0; | ||
182 | if (should_sleep) { | 184 | if (should_sleep) { |
183 | spin_unlock(&journal->j_state_lock); | 185 | spin_unlock(&journal->j_state_lock); |
184 | schedule(); | 186 | schedule(); |