Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp942848lqp; Thu, 23 May 2024 05:01:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX117d0MyQiJnh/s/ZIPuZjfqKOCU8X8zh5W2bMZH0qR2kUuz2am4tIuLBjPdH9yBMEMb8IaCjW92CDz7eVX64GzhKjBTn+7lfFDBlqTQ== X-Google-Smtp-Source: AGHT+IGxYrY28QcsfNCyL28/cso7UNVxZGd2Ac5dDphR7jc9eHKowO/tftzATs15KvVJu6szvnmv X-Received: by 2002:a50:c058:0:b0:56c:522f:53e1 with SMTP id 4fb4d7f45d1cf-578329fe256mr3915048a12.17.1716465707655; Thu, 23 May 2024 05:01:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716465707; cv=pass; d=google.com; s=arc-20160816; b=euBm5++GbI7F2W+v24wk92hfcNFC3x7HHy7eaLZWDZtXMfvDrp7scYf0KXecIXPz2s qn44zEKEgXW88FZMonkuKf5vhCY9zD19WrRoG6sUOgniYDVXmELeZqrus7egc+HdSlAQ EFeBacqRXIlURlV0EM1FJUuT3GJFTD5bL4KljnTWmiUDrOSyee17b8+GHCWK3IHrbR5A WlhPPh1diSWSLH3uCx2p1aiHRroFYcoCZ8hQ4g0V0PTAQYFrtYxzC86MeC3pjqY/ML0j TBcXbJk56GsPqMwnZVM0SLHNAUbwXTW8MYOAPYxlDLorASxf8h7f9/a6Tua72EsNyiha ZYCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CEwOioucTuPuwXHxWvNjOXgp62+huELivUP86yVQ1jA=; fh=e3vfAxjrNDwLLohAkl2wDDE9ERDb3n48SK1G5IZkFag=; b=RYLu+mVEPggID4EkFnFe874P5SyOUvfOkcfisW+ycBtl+AZ4NoiOwWzHssZaAdtcOy foSeoBbdpsJbo+hJDt5xG2DVgFpyOfAEBqisVUj4gTdEfFp5ok08CJNLSs11M5L1vrNf 1+w2QPdoU7ez3avNNfyZQ0dWgkvZo826LE86FX0xVoHQDpslQPxhNCt2yRcxgUq8X7dV kqyoahs+FazEkIBJD4MMmyNnybSkIocppvsw1QhK2jOerGQCivGjXzcsM1wA1G5hWXFP 9eVAgItTQjZYFbSGEZ6C6aJpjLnBF94MX3r1nMIvKElzloAIzSDc53C25jT1Zxz9OM2o FNIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fpn8Rvcu; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-187429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c36e85esi16116898a12.573.2024.05.23.05.01.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 05:01:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fpn8Rvcu; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-187429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 64B9C1F22A5A for ; Thu, 23 May 2024 12:01:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B029C13C661; Thu, 23 May 2024 12:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fpn8Rvcu" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D812113B5B0; Thu, 23 May 2024 12:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716465699; cv=none; b=DnffSxpKo7n0ktERCApom7sQa7KIGV1E2UZyJFDfjknqiegFTWJeF/4YaoB/dwtvoMPfZx4Y7ftZRfJkttMb6lVlAcj82ba43j2l6pstsVGROu1kjVZiTpN8Ec9sbaWKYsTVcnuVWd959geYn8ez9kOVx04zmwUthT3G8UlOdq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716465699; c=relaxed/simple; bh=h02E3oFYubYEDTBjPHWQMILPffcs9Y5ozx2D/Cpn738=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Mdjb58sljqwoXM1+OZiC86qxQwlcQrD8f9dA0H++6qJxCzNLTyKvTINhx596xYaG4GiR8Eb92FbOGsNhjIB9rqobnniFrR7ZR9TZ+qgXzgD76zqmqBC2vVwc35npGj35wwXQL22vqwgL2Sjl4ado3C8XSje+GdC1bJNiOoSsRIE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fpn8Rvcu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17325C2BD10; Thu, 23 May 2024 12:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716465698; bh=h02E3oFYubYEDTBjPHWQMILPffcs9Y5ozx2D/Cpn738=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fpn8RvcuUBRaz0NAFbRL3QRC+uHBJU3DeW2OxTGOqNvHMpY9AoFhxyqd/6nNPKCqg B5c+Y6fTDx2jPGjC5aaJfpTBMawrkUOZ9zERlGDpYno8aPHMkS8hffWv2wznr2JqdX SCXM0NgarcfTfVK2zuvxskahj0cQDQQeeFqexANY= Date: Thu, 23 May 2024 14:01:35 +0200 From: Greg Kroah-Hartman To: Gao Xiang Cc: stable@vger.kernel.org, linux-erofs@lists.ozlabs.org, Baokun Li , LKML , Christian Brauner , Jingbo Xu , Chao Yu Subject: Re: [PATCH 6.8.y 2/2] erofs: reliably distinguish block based and fscache mode Message-ID: <2024052329-apostle-product-fced@gregkh> References: <20240521065032.4192363-1-hsiangkao@linux.alibaba.com> <20240521065032.4192363-2-hsiangkao@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240521065032.4192363-2-hsiangkao@linux.alibaba.com> On Tue, May 21, 2024 at 02:50:32PM +0800, Gao Xiang wrote: > From: Christian Brauner > > commit 7af2ae1b1531feab5d38ec9c8f472dc6cceb4606 upstream. > > When erofs_kill_sb() is called in block dev based mode, s_bdev may not > have been initialised yet, and if CONFIG_EROFS_FS_ONDEMAND is enabled, > it will be mistaken for fscache mode, and then attempt to free an anon_dev > that has never been allocated, triggering the following warning: > > ============================================ > ida_free called for id=0 which is not allocated. > WARNING: CPU: 14 PID: 926 at lib/idr.c:525 ida_free+0x134/0x140 > Modules linked in: > CPU: 14 PID: 926 Comm: mount Not tainted 6.9.0-rc3-dirty #630 > RIP: 0010:ida_free+0x134/0x140 > Call Trace: > > erofs_kill_sb+0x81/0x90 > deactivate_locked_super+0x35/0x80 > get_tree_bdev+0x136/0x1e0 > vfs_get_tree+0x2c/0xf0 > do_new_mount+0x190/0x2f0 > [...] > ============================================ > > Now when erofs_kill_sb() is called, erofs_sb_info must have been > initialised, so use sbi->fsid to distinguish between the two modes. > > Signed-off-by: Christian Brauner > Signed-off-by: Baokun Li > Reviewed-by: Jingbo Xu > Reviewed-by: Gao Xiang > Reviewed-by: Chao Yu > Link: https://lore.kernel.org/r/20240419123611.947084-3-libaokun1@huawei.com > Signed-off-by: Gao Xiang > --- > fs/erofs/super.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) All now queued up, thanks. greg k-h