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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux