linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [JBD] Handle j_commit_interval == 0
@ 2003-11-29  9:24 Herbert Xu
  2003-11-30  9:50 ` Ingo Oeser
  0 siblings, 1 reply; 2+ messages in thread
From: Herbert Xu @ 2003-11-29  9:24 UTC (permalink / raw)
  To: Marcelo Tosatti, Jens Axboe, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

Hi:

After the laptop mode patch was merged, it is now possible for
j_commit_interval to be zero.  Unfortunately jbd doesn't handle
this situation very well.

This patch makes it do the sensible thing.

Cheers,
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 2193 bytes --]

Index: kernel-source-2.4/fs/jbd/journal.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.4/fs/jbd/journal.c,v
retrieving revision 1.1.1.9
diff -u -r1.1.1.9 journal.c
--- kernel-source-2.4/fs/jbd/journal.c	29 Nov 2003 06:39:14 -0000	1.1.1.9
+++ kernel-source-2.4/fs/jbd/journal.c	29 Nov 2003 09:20:32 -0000
@@ -253,6 +253,7 @@
 
 		/* Were we woken up by a commit wakeup event? */
 		if ((transaction = journal->j_running_transaction) != NULL &&
+		    journal->j_commit_interval &&
 		    time_after_eq(jiffies, transaction->t_expires)) {
 			journal->j_commit_request = transaction->t_tid;
 			jbd_debug(1, "woke because of timeout\n");
Index: kernel-source-2.4/fs/jbd/transaction.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.4/fs/jbd/transaction.c,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 transaction.c
--- kernel-source-2.4/fs/jbd/transaction.c	28 Nov 2003 18:26:21 -0000	1.1.1.6
+++ kernel-source-2.4/fs/jbd/transaction.c	29 Nov 2003 06:59:58 -0000
@@ -60,10 +60,12 @@
 	INIT_LIST_HEAD(&transaction->t_jcb);
 
 	/* Set up the commit timer for the new transaction. */
-	J_ASSERT (!journal->j_commit_timer_active);
-	journal->j_commit_timer_active = 1;
-	journal->j_commit_timer->expires = transaction->t_expires;
-	add_timer(journal->j_commit_timer);
+	if (journal->j_commit_interval) {
+		J_ASSERT (!journal->j_commit_timer_active);
+		journal->j_commit_timer_active = 1;
+		journal->j_commit_timer->expires = transaction->t_expires;
+		add_timer(journal->j_commit_timer);
+	}
 	
 	J_ASSERT (journal->j_running_transaction == NULL);
 	journal->j_running_transaction = transaction;
@@ -1465,7 +1467,8 @@
 	if (handle->h_sync ||
 			transaction->t_outstanding_credits >
 				journal->j_max_transaction_buffers ||
-	    		time_after_eq(jiffies, transaction->t_expires)) {
+	    		(journal->j_commit_interval &&
+	    		 time_after_eq(jiffies, transaction->t_expires))) {
 		/* Do this even for aborted journals: an abort still
 		 * completes the commit thread, it just doesn't write
 		 * anything to disk. */

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

end of thread, other threads:[~2003-11-30 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-29  9:24 [JBD] Handle j_commit_interval == 0 Herbert Xu
2003-11-30  9:50 ` Ingo Oeser

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).