From: Hans de Goede <hdegoede@redhat.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Christoph Hellwig <hch@infradead.org>,
Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] vboxsf: Avoid an spurious warning if load_nls_xxx() fails
Date: Wed, 3 Apr 2024 16:10:18 +0200 [thread overview]
Message-ID: <95be6ebf-9f45-404c-a643-89dd6ee4efdf@redhat.com> (raw)
In-Reply-To: <d09eaaa4e2e08206c58a1a27ca9b3e81dc168773.1698835730.git.christophe.jaillet@wanadoo.fr>
Hi,
On 11/1/23 11:49 AM, Christophe JAILLET wrote:
> If an load_nls_xxx() function fails a few lines above, the 'sbi->bdi_id' is
> still 0.
> So, in the error handling path, we will call ida_simple_remove(..., 0)
> which is not allocated yet.
>
> In order to prevent a spurious "ida_free called for id=0 which is not
> allocated." message, tweak the error handling path and add a new label.
>
> Fixes: 0fd169576648 ("fs: Add VirtualBox guest shared folder (vboxsf) support")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Thanks, both patches in this series look good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
I have added both patches to my local vboxsf branch now and I'll send
out a pull-request with this and a couple of other vboxsf fixes
soon.
Regards,
Hans
> ---
> fs/vboxsf/super.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c
> index 1fb8f4df60cb..9848af78215b 100644
> --- a/fs/vboxsf/super.c
> +++ b/fs/vboxsf/super.c
> @@ -151,7 +151,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
> if (!sbi->nls) {
> vbg_err("vboxsf: Count not load '%s' nls\n", nls_name);
> err = -EINVAL;
> - goto fail_free;
> + goto fail_destroy_idr;
> }
> }
>
> @@ -224,6 +224,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
> ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
> if (sbi->nls)
> unload_nls(sbi->nls);
> +fail_destroy_idr:
> idr_destroy(&sbi->ino_idr);
> kfree(sbi);
> return err;
prev parent reply other threads:[~2024-04-03 14:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 10:49 [PATCH 1/2] vboxsf: Avoid an spurious warning if load_nls_xxx() fails Christophe JAILLET
2023-11-01 10:49 ` [PATCH 2/2] vboxsf: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2023-11-01 10:59 ` [PATCH 1/2] vboxsf: Avoid an spurious warning if load_nls_xxx() fails Hans de Goede
2023-11-02 12:30 ` Matthew Wilcox
2023-11-02 21:21 ` Christophe JAILLET
2024-04-03 14:10 ` Hans de Goede [this message]
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=95be6ebf-9f45-404c-a643-89dd6ee4efdf@redhat.com \
--to=hdegoede@redhat.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=hch@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).