summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSu Yue <suy.fnst@cn.fujitsu.com>2017-09-27 14:34:38 +0800
committerDavid Sterba <dsterba@suse.com>2017-11-14 15:59:00 +0100
commitc955dbd7fe67df576667d03f2cd58ff06334524e (patch)
tree01c41d3c02b8fc2c739c27280b62205045640012
parentc1be8557658055746e68278fe5a904b627a9d091 (diff)
btrfs-progs: check: error or return value of repair_root_items()
Return value of repair_root_items(): <0 on error =0 does nothing >0 if repair is enabled, N roots are repaired; else N roots are corrupted. In the repair mode, there should be no error if the return value is bigger than 0. This fixes the test fsck/006 again. Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--cmds-check.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds-check.c b/cmds-check.c
index a5cd1b1e..4528b932 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -14813,8 +14813,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;
}