]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
btrfs: Free checksum list on scrub_extent() fail
authorZhao Lei <zhaolei@cn.fujitsu.com>
Tue, 21 Jul 2015 04:22:30 +0000 (12:22 +0800)
committerChris Mason <clm@fb.com>
Sun, 9 Aug 2015 14:07:11 +0000 (07:07 -0700)
When scrub_extent() failed, we need to free previois created
checksum list.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/scrub.c

index d99cdb11d4d9467dd3e742fe2dc1602af0e185c5..6987de6b1ed83547aac4de702b36270254a88df8 100644 (file)
@@ -2924,10 +2924,12 @@ again:
                                                      extent_dev, flags,
                                                      generation,
                                                      extent_mirror_num);
+
+                       scrub_free_csums(sctx);
+
                        if (ret)
                                goto out;
 
-                       scrub_free_csums(sctx);
                        if (extent_logical + extent_len <
                            key.objectid + bytes) {
                                logic_start += map->stripe_len;
@@ -3262,10 +3264,12 @@ again:
                                           extent_physical, extent_dev, flags,
                                           generation, extent_mirror_num,
                                           extent_logical - logical + physical);
+
+                       scrub_free_csums(sctx);
+
                        if (ret)
                                goto out;
 
-                       scrub_free_csums(sctx);
                        if (extent_logical + extent_len <
                            key.objectid + bytes) {
                                if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) {