All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Anna-Maria Gleixner <anna-maria@linutronix.de>,
	Julia Cartwright <julia@ni.com>
Subject: Re: [PATCH 5/7] jbd2: Don't call __bforget() unnecessarily
Date: Mon, 28 Oct 2019 12:01:36 -0400	[thread overview]
Message-ID: <20191028160136.GC4404@mit.edu> (raw)
In-Reply-To: <20191028152808.GB4404@mit.edu>

On Mon, Oct 28, 2019 at 11:28:08AM -0400, Theodore Y. Ts'o wrote:
> drop:
> 	jbd_unlock_bh_state(bh);
> 	__brelse(bh);
> 	if (drop_reserve) {
> 		/* no need to reserve log space for this block -bzzz */
> 		handle->h_buffer_credits++;
> 	}
> 	return err;
> 
> not_jbd:
> 	jbd_unlock_bh_state(bh);
> 	__bforget(bh);
> 	goto drop;
> ----
> 
> And we still have a case we jump to not_jbd, at which point hilarity
> will ensue.
> 
> This is cleaned up in the following patch in this sequence, but this
> leaves us in a not-great state if we are ever bisecting.

Proposed fixup: I'll apply the following on top of this commit, and
then fix the merge conflicts in 6/7 so that the end result looks the
same as before.

Jan, any objections?  I figure this way it'll save you from resending
the patch series, since the rest of it looks fine to me.

							- Ted


diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index f2af4afc690a..c7c9a42451c7 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -1541,8 +1541,11 @@ int jbd2_journal_forget (handle_t *handle, struct buffer_head *bh)
 
 	jbd_lock_bh_state(bh);
 
-	if (!buffer_jbd(bh))
-		goto not_jbd;
+	if (!buffer_jbd(bh)) {
+		jbd_unlock_bh_state(bh);
+		__bforget(bh);
+		return 0;
+	}
 	jh = bh2jh(bh);
 
 	/* Critical error: attempting to delete a bitmap buffer, maybe?
@@ -1671,11 +1674,6 @@ int jbd2_journal_forget (handle_t *handle, struct buffer_head *bh)
 		handle->h_buffer_credits++;
 	}
 	return err;
-
-not_jbd:
-	jbd_unlock_bh_state(bh);
-	__bforget(bh);
-	goto drop;
 }
 
 /**

  reply	other threads:[~2019-10-28 16:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09 12:42 [PATCH 0/7 v2] jbd2: Bit spinlock conversions Jan Kara
2019-08-09 12:42 ` [PATCH 1/7] jbd2: Simplify journal_unmap_buffer() Jan Kara
2019-08-09 12:42 ` [PATCH 2/7] jbd2: Remove jbd_trylock_bh_state() Jan Kara
2019-08-09 12:42 ` [PATCH 3/7] jbd2: Move dropping of jh reference out of un/re-filing functions Jan Kara
2019-08-09 12:42 ` [PATCH 4/7] jbd2: Drop unnecessary branch from jbd2_journal_forget() Jan Kara
2019-08-09 12:42 ` [PATCH 5/7] jbd2: Don't call __bforget() unnecessarily Jan Kara
2019-10-28 15:28   ` Theodore Y. Ts'o
2019-10-28 16:01     ` Theodore Y. Ts'o [this message]
2019-10-30 11:49       ` Jan Kara
2019-08-09 12:42 ` [PATCH 6/7] jbd2: Make state lock a spinlock Jan Kara
2019-08-09 12:42 ` [PATCH 7/7] jbd2: Free journal head outside of locked region Jan Kara
2019-10-11 12:31 ` [PATCH 0/7 v2] jbd2: Bit spinlock conversions Sebastian Andrzej Siewior
2019-11-03 19:01 ` Theodore Y. Ts'o
  -- strict thread matches above, loose matches on Subject: below --
2019-08-02 15:13 [PATCH 0/7] " Jan Kara
2019-08-02 15:13 ` [PATCH 5/7] jbd2: Don't call __bforget() unnecessarily Jan Kara

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=20191028160136.GC4404@mit.edu \
    --to=tytso@mit.edu \
    --cc=anna-maria@linutronix.de \
    --cc=jack@suse.cz \
    --cc=julia@ni.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 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.