From: Zou Nan hai <nanhai.zou@intel.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@osdl.org>
Subject: [Patch] jbd commit code deadloop when installing Linux
Date: 28 Jun 2006 12:48:43 +0800 [thread overview]
Message-ID: <1151470123.6052.17.camel@linux-znh> (raw)
We see system hang in ext3 jbd code
when Linux install program anaconda copying
packages.
That is because anaconda is invoked from linuxrc
in initrd when system_state is still SYSTEM_BOOTING.
Thus the cond_resched checks in journal_commit_transaction
will always return 1 without actually schedule,
then the system fall into deadloop.
The patch will fix the issue.
Zou Nan hai
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
--- linux-2.6.17/fs/jbd/commit.c 2006-06-18 09:49:35.000000000 +0800
+++ b/fs/jbd/commit.c 2006-06-28 14:15:41.000000000 +0800
@@ -625,8 +625,17 @@ wait_for_iobuf:
wait_on_buffer(bh);
goto wait_for_iobuf;
}
- if (cond_resched())
- goto wait_for_iobuf;
+ if (cond_resched()) {
+ if (commit_transaction->t_iobuf_list != NULL) {
+ jh = commit_transaction->t_iobuf_list->b_tprev;
+ bh = jh2bh(jh);
+ if (buffer_locked(bh)) {
+ wait_on_buffer(bh);
+ goto wait_for_iobuf;
+ }
+ } else
+ break;
+ }
if (unlikely(!buffer_uptodate(bh)))
err = -EIO;
@@ -681,8 +690,17 @@ wait_for_iobuf:
wait_on_buffer(bh);
goto wait_for_ctlbuf;
}
- if (cond_resched())
- goto wait_for_ctlbuf;
+ if (cond_resched()) {
+ if(commit_transaction->t_log_list != NULL) {
+ jh = commit_transaction->t_log_list->b_tprev;
+ bh = jh2bh(jh);
+ if (buffer_locked(bh)) {
+ wait_on_buffer(bh);
+ goto wait_for_ctlbuf;
+ }
+ }else
+ break;
+ }
if (unlikely(!buffer_uptodate(bh)))
err = -EIO;
next reply other threads:[~2006-06-28 6:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-28 4:48 Zou Nan hai [this message]
2006-06-28 6:40 ` [Patch] jbd commit code deadloop when installing Linux Andrew Morton
2006-06-28 6:38 ` Ingo Molnar
2006-06-28 6:55 ` Andrew Morton
2006-06-28 5:46 ` Zou Nan hai
2006-06-28 7:39 ` Ingo Molnar
2006-06-28 7:40 ` Andrew Morton
2006-06-28 6:02 ` Zou Nan hai
2006-06-28 8:04 ` Andrew Morton
2006-06-28 6:50 ` Zou Nan hai
2006-06-28 8:45 ` Andrew Morton
2006-06-28 7:14 ` Zou Nan hai
2006-06-28 9:29 ` Ingo Molnar
2006-06-28 7:55 ` Ingo Molnar
2006-06-28 9:10 ` Arjan van de Ven
2006-06-28 7:32 ` Zou Nan hai
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=1151470123.6052.17.camel@linux-znh \
--to=nanhai.zou@intel.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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