From: Shilong Wang Date: Sun, 12 Apr 2015 06:35:20 +0000 (+0800) Subject: Btrfs: fix wrong check for btrfs_force_chunk_alloc() X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78512fba8fcfd9af9b59188e1cd004d067192e7a;p=linux Btrfs: fix wrong check for btrfs_force_chunk_alloc() 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 Reviewed-by: Filipe Manana Tested-by: Filipe Manana (cherry picked from commit 9ac2b7cb4755cb3311bb7d1ccf0eb51d0e006fba) --- diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 74b24b01d574..790a8ed17c44 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -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;