In lowmem mode with '--repair', check_chunks_and_extents_v2()
will fix accounting in block groups and clear the error
bit BG_ACCOUNTING_ERROR.
However, return value of check_btrfs_root() is 0 either 1 instead of
error bits.

If extent tree is on error, lowmem repair always prints error and
returns nonzero value even the filesystem is fine after repair.

So let @err contains bits after walk_down_tree_v2().

Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
 cmds-check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmds-check.c b/cmds-check.c
index 3a72f8e3877d..c7b570bef9c3 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -6607,7 +6607,7 @@ static int check_btrfs_root(struct btrfs_trans_handle 
*trans,
                ret = walk_down_tree_v2(trans, root, &path, &level, &nrefs,
                                        ext_ref, check_all);
 
-               err |= !!ret;
+               err |= ret;
 
                /* if ret is negative, walk shall stop */
                if (ret < 0) {
-- 
2.15.0



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to