linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Marcelo Tosatti <marcelo@conectiva.com.br>,
	Jens Axboe <axboe@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [JBD] Handle j_commit_interval == 0
Date: Sat, 29 Nov 2003 20:24:58 +1100	[thread overview]
Message-ID: <20031129092458.GA19338@gondor.apana.org.au> (raw)

[-- 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. */

             reply	other threads:[~2003-11-29  9:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-29  9:24 Herbert Xu [this message]
2003-11-30  9:50 ` [JBD] Handle j_commit_interval == 0 Ingo Oeser

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=20031129092458.GA19338@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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;
as well as URLs for NNTP newsgroup(s).