From: Jan Kara <jack@suse.cz>
To: Zoltan Menyhart <Zoltan.Menyhart@bull.net>
Cc: linux-kernel@vger.kernel.org, sct@redhat.com
Subject: Re: [PATCH] Change ll_rw_block() calls in JBD
Date: Wed, 21 Jun 2006 02:09:16 +0200 [thread overview]
Message-ID: <20060621000916.GA19013@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <44982344.2060507@bull.net>
Hi,
> I have got some crashes due to:
>
> Assertion failure in __journal_file_buffer():
> "jh->b_transaction == transaction || jh->b_transaction == 0"
Yes, I've seen your reports. Thanks for them and sorry for being a bit
unresponsive (I have a lot of other work...).
<snip>
>
> --- Called from --- :
>
> journal_submit_data_buffers+0x200/0x660 [jbd]
> r32 : e0000001035ec100 journal
> r33 : e00000010396a380 commit_transaction
>
> As you can see, the current "jh" has been stolen for the new
> "->j_running_transaction" while we released temporarily "->j_list_lock"
> in the middle of "journal_submit_data_buffers()".
Yes, this seems to be correct analysis.
> Therefore the test "jh->b_jlist != BJ_SyncData", i.e. if it is still
> on a (_any_) sync. list is not enough.
Right.
> --- linux-2.6.16.20-orig/fs/jbd/commit.c 2006-06-20
> 17:19:47.000000000 +0200
> +++ linux-2.6.16.20/fs/jbd/commit.c 2006-06-20 17:35:54.000000000 +0200
> @@ -219,15 +219,26 @@
> bufs = 0;
> lock_buffer(bh);
> spin_lock(&journal->j_list_lock);
> + /* Stolen (e.g. for a new transaction) ? */
> + if (jh !=
> commit_transaction->t_sync_datalist) {
> + unlock_buffer(bh);
> + JBUFFER_TRACE(jh, "stolen sync.
> data");
> + put_bh(bh);
> + continue;
> + }
Yes, this is definitely safer check and should also catch the case
when jh was released from memory so buffer_jbd() is not needed any more.
> /* Someone already cleaned up the buffer? */
> - if (!buffer_jbd(bh)
> - || jh->b_jlist != BJ_SyncData) {
> +
> + // Can this happen???
> +
> + if (!buffer_jbd(bh)) {
> unlock_buffer(bh);
> BUFFER_TRACE(bh, "already cleaned
> up");
> put_bh(bh);
> continue;
> }
> put_bh(bh);
> + J_ASSERT_JH(jh, jh->b_transaction ==
> + commit_transaction);
> }
> if (test_clear_buffer_dirty(bh)) {
> BUFFER_TRACE(bh, "needs writeout,
> submitting");
>
> I am not really sure that the test "!buffer_jbd(bh)" is really useful.
> I left it alone for not introducing a new bug.
> If you can confirm that it is not necessary, I can take it away.
BTW: I've also written another version of the patch using a bit
different approach. When I have some time I can benchmark them against
each other to see if there is some difference...
Honza
--
Jan Kara <jack@suse.cz>
SuSE CR Labs
next prev parent reply other threads:[~2006-06-21 0:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-18 8:25 [PATCH] Change ll_rw_block() calls in JBD Zoltan Menyhart
2006-05-18 13:45 ` Jan Kara
2006-05-18 15:11 ` Zoltan Menyhart
2006-05-18 22:25 ` Stephen C. Tweedie
2006-05-19 10:01 ` Zoltan Menyhart
2006-05-19 12:26 ` Stephen C. Tweedie
2006-05-19 1:30 ` Jan Kara
2006-05-19 12:33 ` Zoltan Menyhart
2006-05-19 15:05 ` Stephen C. Tweedie
2006-05-19 15:06 ` Stephen C. Tweedie
2006-05-24 17:33 ` Jan Kara
2006-05-30 15:36 ` Zoltan Menyhart
2006-05-30 16:40 ` Jan Kara
2006-05-23 16:01 ` Zoltan Menyhart
2006-05-24 9:14 ` Zoltan Menyhart
2006-05-24 17:18 ` Jan Kara
[not found] ` <447F13B3.6050505@bull.net>
[not found] ` <20060601162751.GH26933@atrey.karlin.mff.cuni.cz>
[not found] ` <44801E16.3040300@bull.net>
[not found] ` <20060602134923.GA1644@atrey.karlin.mff.cuni.cz>
2006-06-20 16:33 ` Zoltan Menyhart
2006-06-21 0:09 ` Jan Kara [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-07-11 15:52 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=20060621000916.GA19013@atrey.karlin.mff.cuni.cz \
--to=jack@suse.cz \
--cc=Zoltan.Menyhart@bull.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sct@redhat.com \
/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).