From: Darrick J. Wong Date: Fri, 19 Sep 2014 01:46:10 +0000 (-0400) Subject: e2fsck: free bh when descriptor block checksum fails X-Git-Tag: v1.43-WIP-2015-05-18~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c10700f9748e54748f88a22554da3dca4b7fc234;p=thirdparty%2Fe2fsprogs.git e2fsck: free bh when descriptor block checksum fails Free the buffer head if the journal descriptor block fails checksum verification. This has been patched before (see "e2fsck: free bh on csum verify error in do_one_pass") but apparently the patch was never committed to jbd2 in the kernel, so when we resync'd the recovery code with 3.16, the bug came back. Sigh. Signed-off-by: Darrick J. Wong Cc: Eric Sandeen Signed-off-by: Theodore Ts'o Reviewed-by: Eric Sandeen --- diff --git a/e2fsck/recovery.c b/e2fsck/recovery.c index 3dc7c06c1..b5ce3b3c4 100644 --- a/e2fsck/recovery.c +++ b/e2fsck/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; }