jbd2: free bh when descriptor block checksum fails
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 16 Sep 2014 18:43:09 +0000 (14:43 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 16 Sep 2014 18:43:09 +0000 (14:43 -0400)
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 <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Cc: stable@vger.kernel.org
fs/jbd2/recovery.c

index 9b329b55ffe3726a611ccf8282190e420d173080..bcbef08a4d8fc8873994eb37d35881626f05af70 100644 (file)
@@ -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;
                        }