diff mbox

Btrfs: add missing brelse when superblock checksum fails

Message ID 1444035320-9400-1-git-send-email-anand.jain@oracle.com (mailing list archive)
State Superseded
Headers show

Commit Message

Anand Jain Oct. 5, 2015, 8:55 a.m. UTC
looks like oversight, call brelse() when checksum fails.
further down the code in the non error path we do call
brelse() and so we don't see brelse() in the goto error..
paths.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/disk-io.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Sterba Oct. 7, 2015, 8:54 a.m. UTC | #1
On Mon, Oct 05, 2015 at 04:55:20PM +0800, Anand Jain wrote:
> looks like oversight, call brelse() when checksum fails.
> further down the code in the non error path we do call
> brelse() and so we don't see brelse() in the goto error..
> paths.

Good catch. Please reformat the changelog to use the full 74 char line
and start sentences with capital letters.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 7191b32..99d0804 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2665,6 +2665,7 @@  int open_ctree(struct super_block *sb,
 	if (btrfs_check_super_csum(bh->b_data)) {
 		printk(KERN_ERR "BTRFS: superblock checksum mismatch\n");
 		err = -EINVAL;
+		brelse(bh);
 		goto fail_alloc;
 	}