]> git.hungrycats.org Git - linux/commitdiff
Btrfs: add missing brelse when superblock checksum fails
authorAnand Jain <anand.jain@oracle.com>
Wed, 7 Oct 2015 09:23:23 +0000 (17:23 +0800)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Sat, 16 Jan 2016 03:21:58 +0000 (22:21 -0500)
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>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit b2acdddfad13c38a1e8b927d83c3cf321f63601a)

fs/btrfs/disk-io.c

index 011819f799206586d6f7dc68b34a765839495c28..eb7b9a173980dd4ac30126523eeaff2d82ffeb7e 100644 (file)
@@ -2631,6 +2631,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;
        }