[PATCH 3.10.y] [FIX BAD BACKPORT] Btrfs: add missing brelse when superblock checksum fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit b2acdddfad13c38a1e8b927d83c3cf321f63601a upstream.

linux-3.10.y commit bf00d124e07 (Btrfs: add missing brelse when
superblock checksum fails) was misapplied to a later error handling
site.  The result is that it doesn't actually free the buffer on
checksum failure but does attempt to double free the buffer if
unsupported features are used.

The backport of b2acdddfad1 in other branches is correct.

Cc: <stable@xxxxxxxxxxxxxxx> # 3.10
Cc: Anand Jain <anand.jain@xxxxxxxxxx>
Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx>
---
 fs/btrfs/disk-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 9612a01198df..c690886f2813 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2311,6 +2311,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;
 	}
 
@@ -2437,7 +2438,6 @@ int open_ctree(struct super_block *sb,
 		       "unsupported option features (%Lx).\n",
 		       (unsigned long long)features);
 		err = -EINVAL;
-		brelse(bh);
 		goto fail_alloc;
 	}
 
-- 
2.14.2


-- 
Jeff Mahoney
SUSE Labs



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]