[PATCH 1/3] btrfs-progs: rescue: properly close the fs for clear-ino-cache

Qu Wenruo
2024-02-02T00:59:42Z

[BUG]
In cmd_rescue_clear_ino_cache(), we opened the fs, but without
closing it using close_ctree().

[CAUSE]
All my bad, I forgot it, as the original code is inside btrfs check, and
had a "goto out_close;" to properly close the fs.

[FIX]
Manually call close_ctree() on the fs_info->tree_root.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
cmds/rescue.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/cmds/rescue.c b/cmds/rescue.c
index 621e243b2073..6d7d526df145 100644
--- a/cmds/rescue.c
+++ b/cmds/rescue.c
@@ -451,6 +451,7 @@ static int cmd_rescue_clear_ino_cache(const struct cmd_struct *cmd,
} else {
pr_verbose(LOG_DEFAULT, "Successfully cleared ino cache");
}
+ close_ctree(fs_info->tree_root);
out:
return !!ret;
}
--
2.43.0