diff mbox

[V2] Btrfs: add missing brelse when superblock checksum fails

Message ID 1444209803-16101-1-git-send-email-anand.jain@oracle.com (mailing list archive)
State Accepted
Headers show

Commit Message

Anand Jain Oct. 7, 2015, 9:23 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>
---
V2: Updated changelog

 fs/btrfs/disk-io.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Sterba Oct. 7, 2015, 9:37 a.m. UTC | #1
On Wed, Oct 07, 2015 at 05:23:23PM +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.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Thanks!

Reviewed-by: David Sterba <dsterba@suse.com>
--
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 c7c739f..1b72cb5 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;
 	}