From patchwork Wed Nov 1 10:49:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 160513 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp324196vqx; Wed, 1 Nov 2023 03:50:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEq00FqWth9ql2KcDX0dOnOPb4VfsV399HpHIoM/8/O4ZsOD6wwc98fq+LxUWZM18dYasy/ X-Received: by 2002:a05:6359:2e07:b0:168:cf8c:7ac8 with SMTP id ro7-20020a0563592e0700b00168cf8c7ac8mr15252691rwb.12.1698835851963; Wed, 01 Nov 2023 03:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698835851; cv=none; d=google.com; s=arc-20160816; b=CKmVR4/0Pk0DSJT5X/nzWXrkbiBbM65M1jHFNVjJrrfWAGGLrjAFHUbcv9JCp15x1H j2PE4nGT9EsSIkyXeNUQVxPXXPd3KshLN48wNgrBywImH0tnIM0tPnvPt5WHpK5kFD0y p9LQhm6Y1OuRkaV2IdMBgORDOcMdwGJB6utZeBfnkqFep+3kSynqRpLgtubanBn4tsx5 PUElkM0bDhVnPyD2pPBAVf1maQDncAV5PaRm/UmtYoY0UZu2T3fzsqAvBBT8kd4BOfLD OtYDPQKAQL5tYsXBIVaUO3or/M2JKt3tRn+h4PC6RGKV1K47r2bIBkIhzr6lOT8XX1Ab 4gpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2aMI4kaZmSRgyVFOxUmjlKR0UB3Yi5s4GgkvE78ZjEk=; fh=jmQMUm/WgXVHQy5l+Yh7s6n45w0r5coBUO+6VAqAxko=; b=woMKl30m7qpUvJiU1asQ4Uj94ZpVGCwLS6/SdgbCnHb510r0STuZaSEH87swG5ii9m F+jTJJVMnBE16EWwVTIvVAn2cW/xv8JnzquS0uc3C3yk262RYI+M7TsEvmRduQ0BH2aM MKb21cbmK9oHis0Tte7XpIz5BxVZBiZLKKoSjYbYj3IkpDP6pQ1sJA1JS4QoL7eqKO5P SoNNyvBo+d7gXsRL+T5zHnxKPI6Yk82n9RctDLIhAq6aXYbn/oI5gVaPBE4r9RssFVfc eBb6nDZyZMhvomaGRYhZk9IqU6+f71sE/fs4OGKfXmR09Wy9VuvimNRNgZv8+SV504lT qfrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=T9ffKPOE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id h7-20020a636c07000000b00573fbbb7803si2567624pgc.613.2023.11.01.03.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 03:50:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=T9ffKPOE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 28401807D42F; Wed, 1 Nov 2023 03:50:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231975AbjKAKt6 (ORCPT + 35 others); Wed, 1 Nov 2023 06:49:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjKAKt5 (ORCPT ); Wed, 1 Nov 2023 06:49:57 -0400 Received: from smtp.smtpout.orange.fr (smtp-25.smtpout.orange.fr [80.12.242.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6AB6103 for ; Wed, 1 Nov 2023 03:49:53 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id y8nGq7z314QsMy8nHquUN7; Wed, 01 Nov 2023 11:49:51 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698835791; bh=2aMI4kaZmSRgyVFOxUmjlKR0UB3Yi5s4GgkvE78ZjEk=; h=From:To:Cc:Subject:Date; b=T9ffKPOEJxbuViGzfFTHIVaSl3YNHy06fGUxFiCi7i5faO8Gl0+r1nO7E87oWuFhe qM9j9M0OYXNJH6UYiqYK59ZHAxvSX1Ml4JdkAdSZk+SEACj/uRcx626tABaKIioR9s NwOrUp+mXZ3zDlkoQgCkFMGtCoeZt4hz76EcUoS6Nh88geZ1R9CQ4MVnAGnWOlmY9L QSZQ3XO0VCGyF76JzVw4Utsj/FazyT37KvHr1Ic0CzSXC6c3ZjeyOOikUkEl8rNxUA oH75VEzI9pzpR8bH22PFnV6rp/W4feAYqkRH3dvTDmkR4nc5XI899dGkd5vvciOncA l/IMGuRwV/7ow== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 01 Nov 2023 11:49:51 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Hans de Goede , Christoph Hellwig , Al Viro Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-fsdevel@vger.kernel.org Subject: [PATCH 1/2] vboxsf: Avoid an spurious warning if load_nls_xxx() fails Date: Wed, 1 Nov 2023 11:49:48 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 01 Nov 2023 03:50:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781358502647636650 X-GMAIL-MSGID: 1781358502647636650 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 Reviewed-by: Hans de Goede --- 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;