From: Anand Jain <anand.jain@oracle.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/3] btrfs-progs: rescue: properly close the fs for clear-ino-cache
Date: Fri, 2 Feb 2024 14:18:38 +0530 [thread overview]
Message-ID: <b95073b4-4b7d-40c0-8ed6-6def8abe4ca3@oracle.com> (raw)
In-Reply-To: <c413bdf50d585364d867192889a761d8785a0ed5.1706827356.git.wqu@suse.com>
On 2/2/24 06:29, Qu Wenruo wrote:
> [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.
Nit:
Forgot to add commit id that missed this?
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Thx. Anand
>
> [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;
> }
next prev parent reply other threads:[~2024-02-02 8:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 0:59 [PATCH 0/3] btrfs-progs: hunt down the stray fd close causing race with udev scan Qu Wenruo
2024-02-02 0:59 ` [PATCH 1/3] btrfs-progs: rescue: properly close the fs for clear-ino-cache Qu Wenruo
2024-02-02 8:48 ` Anand Jain [this message]
2024-02-02 0:59 ` [PATCH 2/3] btrfs-progs: tune: fix the missing close() Qu Wenruo
2024-02-02 9:01 ` Anand Jain
2024-02-02 0:59 ` [PATCH 3/3] btrfs-progs: fix the stray fd close in open_ctree_fs_info() Qu Wenruo
2024-02-07 16:36 ` Anand Jain
2024-02-07 21:05 ` Qu Wenruo
2024-02-08 2:53 ` Anand Jain
2024-02-07 9:52 ` [PATCH 0/3] btrfs-progs: hunt down the stray fd close causing race with udev scan David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b95073b4-4b7d-40c0-8ed6-6def8abe4ca3@oracle.com \
--to=anand.jain@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox