Return value of repair_root_items():
<0 on error
=0 does nothing
>0 if repair is enable, N roots is repaired;
   else N roots is corrupted.

In the repair mode, there should be no error if return value is bigger
than 0.

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 3e2f9faa..adc4a934 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -14646,8 +14646,8 @@ int cmd_check(int argc, char **argv)
 
        if (!init_extent_tree) {
                ret = repair_root_items(info);
-               err |= !!ret;
                if (ret < 0) {
+                       err = !!ret;
                        error("failed to repair root items: %s",
                              strerror(-ret));
                        goto close_out;
-- 
2.14.1



--
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