jbd2: Call the commit callback before the transaction could get dropped
authorTheodore Ts'o <tytso@mit.edu>
Wed, 29 Oct 2008 01:08:20 +0000 (21:08 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 29 Oct 2008 01:08:20 +0000 (21:08 -0400)
commit6c20ec850360bc6e5c66a787f0523a80450d65ab
tree567f496cf53dbfbc235809edac134e0247a062c8
parentef2cabf7c6d838eb0ee2b4fb8ef84f7c06ce16d9
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>
Tested-by: Eric Paris <eparis@redhat.com>
fs/jbd2/commit.c