[2/3,v2] btrfs-progs: check: do not reset ret after try_repair_inode
diff mbox

Message ID 20180109075251.17264-1-suy.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

Su Yue Jan. 9, 2018, 7:52 a.m. UTC
If repair is enabled and try_repair_inode() failed in
check_inode_recs(), then value @ret will be reset to 0 anyway.
Then counter @error won't be incremented.

In other words, if previous check of the root directory is fine,
check_inode_recs() always returns 0 even it failed to repair inodes.

So do not reset @ret after try_repair_inode().

Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
	Add more detailed commit message.
 cmds-check.c | 1 -
 1 file changed, 1 deletion(-)

diff mbox

diff --git a/cmds-check.c b/cmds-check.c
index 635c1c44ff6f..00cbc0114b22 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -3968,7 +3968,6 @@  static int check_inode_recs(struct btrfs_root *root,
-			ret = 0;
 		if (!(repair && ret == 0))