repair_inode_backrefs() forgets to modify backrefs and inode records
after repair them.

Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
 cmds-check.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cmds-check.c b/cmds-check.c
index d8d9a3227c06..b23a4493b12b 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -3192,6 +3192,7 @@ static int repair_inode_backrefs(struct btrfs_root *root,
                                ret = create_inode_item(root, rec, 1);
                                if (ret)
                                        break;
+                               rec->found_inode_item = 1;
                                repaired++;
                        }
                }
@@ -3268,6 +3269,8 @@ static int repair_inode_backrefs(struct btrfs_root *root,
                                                    backref->index);
                        BUG_ON(ret);
                        btrfs_commit_transaction(trans, root);
+                       backref->found_dir_index = 1;
+                       backref->found_dir_item = 1;
                        repaired++;
                }
 
@@ -3279,6 +3282,7 @@ static int repair_inode_backrefs(struct btrfs_root *root,
                        ret = create_inode_item(root, rec, 0);
                        if (ret)
                                break;
+                       rec->found_inode_item = 1;
                        repaired++;
                }
 
-- 
2.16.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