From da1d497a164639b36995773fbb70873f1548e2c9 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Fri, 2 Feb 2024 11:29:19 +1030 Subject: [PATCH] btrfs-progs: rescue: properly close the fs for clear-ino-cache [BUG] In cmd_rescue_clear_ino_cache(), we opened the fs, but without closing it using close_ctree(). [CAUSE] This was introduced in 42404a4e448c2e ("btrfs-progs: move inode cache removal to rescue group"), the original code inside btrfs check had a "goto out_close;" to properly close the fs. [FIX] Manually call close_ctree() on the fs_info->tree_root. Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- cmds/rescue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds/rescue.c b/cmds/rescue.c index 621e243b..6d7d526d 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; }