Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp815100rdb; Wed, 1 Nov 2023 03:50:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLzuLHgEr4aegeG5285BJGNM/GzhCp39V/Zc+Tds/+a1+xJLW1fCM+SRZtuB+cp1C7vroQ X-Received: by 2002:a05:6358:3386:b0:168:d284:50b5 with SMTP id i6-20020a056358338600b00168d28450b5mr20428250rwd.21.1698835810545; Wed, 01 Nov 2023 03:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698835810; cv=none; d=google.com; s=arc-20160816; b=FjbYfS4rkWzs+TaOxqjPD4k5gEjSSUjJYlGq/jm9XMgnMpf4KquGBeHuBOHo8L6Xd/ 4dpOkfTemmYaBO3/Zd7VF5ztNvVV17MwXarzGYZWHPHx6xEXsd1G5WvtNueycuSsXN/r SdIgODnQkgMlSG0IujEvZzT2VzoMe0aQCtKCeN5QH+AZuWUE7/khL++cVQiQKiuuinzT 89DOY1Yd/MFIf4cDDVRsn+9zyPfuNqJGEsdO/Qlh77vrGjqIbjytzlP5g6GBMyZmzwg9 +Exlv/sma21vQ9FAXYwH83OLPyXbILFAayTO7gUQyNGEu46efBbs/gSmocIbk6mU/oGr x4+w== 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 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id e22-20020a656896000000b005b7c45b1f95si2681519pgt.555.2023.11.01.03.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 03:50:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; 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 2620:137:e000::3:6 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 203268042B6B; Wed, 1 Nov 2023 03:50:05 -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 S231603AbjKAKt6 (ORCPT + 99 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 Content-Transfer-Encoding: 8bit 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:05 -0700 (PDT) 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 --- 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; -- 2.34.1