All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] jbd commit code deadloop when installing Linux
@ 2006-06-28  4:48 Zou Nan hai
  2006-06-28  6:40 ` Andrew Morton
  0 siblings, 1 reply; 16+ messages in thread
From: Zou Nan hai @ 2006-06-28  4:48 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Andrew Morton

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;


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-06-28  9:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-28  4:48 [Patch] jbd commit code deadloop when installing Linux Zou Nan hai
2006-06-28  6:40 ` 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

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.