]> git.hungrycats.org Git - linux/commitdiff
Btrfs: fix wrong check for btrfs_force_chunk_alloc()
authorShilong Wang <wangshilong1991@gmail.com>
Sun, 12 Apr 2015 06:35:20 +0000 (14:35 +0800)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Sat, 4 Jul 2015 02:00:21 +0000 (22:00 -0400)
btrfs_force_chunk_alloc() return 1 for allocation chunk successfully.
This problem exists since commit c87f08ca4.

With this patch, we might fix some enospc problems for balances.

Signed-off-by: Wang Shilong <wangshilong1991@gmail.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Tested-by: Filipe Manana <fdmanana@suse.com>
(cherry picked from commit 9ac2b7cb4755cb3311bb7d1ccf0eb51d0e006fba)

fs/btrfs/relocation.c

index 74b24b01d5740041a69aab1d083391c2e03ade8b..790a8ed17c447c4b0b717785578434f19900b833 100644 (file)
@@ -4040,7 +4040,7 @@ restart:
        if (trans && progress && err == -ENOSPC) {
                ret = btrfs_force_chunk_alloc(trans, rc->extent_root,
                                              rc->block_group->flags);
-               if (ret == 0) {
+               if (ret == 1) {
                        err = 0;
                        progress = 0;
                        goto restart;