aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2024-02-02 11:29:19 +1030
committerDavid Sterba <dsterba@suse.com>2024-02-08 08:30:37 +0100
commitda1d497a164639b36995773fbb70873f1548e2c9 (patch)
treec8a972b935f65e756dfa30e87123c5108b547782
parentfed3806d08f6149977900792fe98285f3c343755 (diff)
downloadbtrfs-progs-da1d497a164639b36995773fbb70873f1548e2c9.tar.gz
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 <anand.jain@oracle.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--cmds/rescue.c1
1 files changed, 1 insertions, 0 deletions
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;
}