From: Eric Sandeen <sandeen@redhat.com>
To: Theodore Tso <tytso@mit.edu>, Eric Sandeen <sandeen@redhat.com>,
Eric Paris <eparis@redhat.com>,
linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH, RFC] jbd2: Call the commit callback before the transaction could get dropped
Date: Mon, 27 Oct 2008 21:41:36 -0500 [thread overview]
Message-ID: <49067BE0.8090904@redhat.com> (raw)
In-Reply-To: <20081028022838.GA8869@mit.edu>
Theodore Tso wrote:
> This is what I plan to send to Linus to fix the problem.
>
> commit 6fecbc3c7d27800e90a5f5fbca2fb2847e2c2854
> Author: Theodore Ts'o <tytso@mit.edu>
> Date: Mon Oct 27 22:11:39 2008 -0400
>
> jbd2: Call the commit callback before the transaction could get dropped
>
> The transaction can potentially get dropped if there are no buffers
> that need to be written. Make sure we call the commit callback before
> potentially deciding to drop the transaction. Also avoid
> dereferencing the commit_transaction pointer in the marker for the
> same reason.
>
> This patch fixes the bug reported by Eric Paris at:
> http://bugzilla.kernel.org/show_bug.cgi?id=11838
>
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Acked-by: Eric Sandeen <sandeen@redhat.com>
> diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
> index 8b119e1..ebc667b 100644
> --- a/fs/jbd2/commit.c
> +++ b/fs/jbd2/commit.c
> @@ -974,6 +974,9 @@ restart_loop:
> journal->j_committing_transaction = NULL;
> spin_unlock(&journal->j_state_lock);
>
> + if (journal->j_commit_callback)
> + journal->j_commit_callback(journal, commit_transaction);
> +
> if (commit_transaction->t_checkpoint_list == NULL &&
> commit_transaction->t_checkpoint_io_list == NULL) {
> __jbd2_journal_drop_transaction(journal, commit_transaction);
> @@ -995,11 +998,8 @@ restart_loop:
> }
> spin_unlock(&journal->j_list_lock);
>
> - if (journal->j_commit_callback)
> - journal->j_commit_callback(journal, commit_transaction);
> -
> trace_mark(jbd2_end_commit, "dev %s transaction %d head %d",
> - journal->j_devname, commit_transaction->t_tid,
> + journal->j_devname, journal->j_commit_sequence,
> journal->j_tail_sequence);
> jbd_debug(1, "JBD: commit %d complete, head %d\n",
> journal->j_commit_sequence, journal->j_tail_sequence);
next prev parent reply other threads:[~2008-10-28 2:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-21 18:03 general protection fault: from release_blocks_on_commit Eric Paris
2008-10-27 18:19 ` Theodore Tso
2008-10-27 22:26 ` Eric Sandeen
2008-10-27 23:28 ` Theodore Tso
2008-10-28 0:08 ` Eric Sandeen
2008-10-28 1:52 ` Theodore Tso
2008-10-28 2:15 ` Eric Sandeen
2008-10-28 2:28 ` [PATCH, RFC] jbd2: Call the commit callback before the transaction could get dropped Theodore Tso
2008-10-28 2:41 ` Eric Sandeen [this message]
2008-10-28 13:46 ` Eric Paris
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=49067BE0.8090904@redhat.com \
--to=sandeen@redhat.com \
--cc=eparis@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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