]> git.hungrycats.org Git - linux/commitdiff
Btrfs: process all async extents on compressed write failure
authorFilipe Manana <fdmanana@suse.com>
Mon, 6 Oct 2014 21:14:25 +0000 (22:14 +0100)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Fri, 23 Jan 2015 13:16:38 +0000 (08:16 -0500)
If we had an error when processing one of the async extents from our list,
we were not processing the remaining async extents, meaning we would leak
those async_extent structs, never release the pages with the compressed
data and never unlock and clear the dirty flag from the inode's pages (those
that correspond to the uncompressed content).

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit 3d7a820f713a1a3339139ea8c86a98437ae0a2c1)

fs/btrfs/inode.c

index ec68eaef05d7ed39bfc3c9a10065a91b0375bfe2..43651692a9509b5431c5a2cfca0e5f0ad17bb6b1 100644 (file)
@@ -830,13 +830,9 @@ retry:
                }
                alloc_hint = ins.objectid + ins.offset;
                kfree(async_extent);
-               if (ret)
-                       goto out;
                cond_resched();
        }
-       ret = 0;
-out:
-       return ret;
+       return 0;
 out_free_reserve:
        btrfs_free_reserved_extent(root, ins.objectid, ins.offset, 1);
 out_free: