From: Darrick J. Wong Date: Tue, 16 Sep 2014 18:43:09 +0000 (-0400) Subject: jbd2: free bh when descriptor block checksum fails X-Git-Tag: upstream/snapshot3+hdmi~1155 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd68851f32f584e645093b8072f270a9829ed7c0;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git jbd2: free bh when descriptor block checksum fails commit 064d83892e9ba547f7d4eae22cbca066d95210ce upstream. Free the buffer head if the journal descriptor block fails checksum verification. This is the jbd2 port of the e2fsprogs patch "e2fsck: free bh on csum verify error in do_one_pass". Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o Reviewed-by: Eric Sandeen Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c index 9b329b5..bcbef08 100644 --- a/fs/jbd2/recovery.c +++ b/fs/jbd2/recovery.c @@ -525,6 +525,7 @@ static int do_one_pass(journal_t *journal, !jbd2_descr_block_csum_verify(journal, bh->b_data)) { err = -EIO; + brelse(bh); goto failed; }