[3/5] btrfs-progs: check: error or return value of repair_root_items()
diff mbox

Message ID 20170927063440.25961-4-suy.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

Su Yue Sept. 27, 2017, 6:34 a.m. UTC
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.fnst@cn.fujitsu.com>
---
 cmds-check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox

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;