Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp180243lqo; Tue, 7 May 2024 16:59:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6xtBPBfv4OFFZCZog6UE8orRj58QG9gS3NM8bsfx5MR0CP5nPGgcC3G4H4OBb/FzyW4SkfUVtEdp/5ixCi/32n94dRUO4SL1Auw35Ow== X-Google-Smtp-Source: AGHT+IGpdF463xjl+w7FtyvmofH8FSe91WjHKBSLUAK2BUu2HU29sPR9YCv/vNuo0A5AH10kG6u6 X-Received: by 2002:ac8:5785:0:b0:43a:43db:641e with SMTP id d75a77b69052e-43dbec04619mr14844151cf.9.1715126362762; Tue, 07 May 2024 16:59:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715126362; cv=pass; d=google.com; s=arc-20160816; b=pLq95II+4i1+Me1eButmdTFbqgZ1RW6ZawmEz6w0tqDME8j73h6pva0rVgh7smg5Sv t4zbFnyZmI8uTapbpHMnQaMVqv5zbERakbeN1O1hkcAExOkbzCd0E5p6e+0HbyryXFcm MwG9jAGa3veVIttZoBYThEHH3FyR74pt/n94ZegPxybvepsMp0ORQZYw62XjVoEDPagt Q2HSRFli8HDx2XND/el2JxubPWMfg4d/7PYoGfgBr/ny56dxg0z3TY8oo9s1gWr1axDz O7dFJp9XOlKrfet5UnpiRsZYdRnM8oj2QdJfCqzeyLegOK90ReZUFZLc2DhEQpqr6dOO MF+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=e0zrxwPcAb6kwy18tLfS3CmdjXGu2j+7ybZ31BCE1es=; fh=yVIGsuzAcP9pItwMjoGd0AT8igbAF8wgrM9esqWlVEU=; b=G57qy6fGh/qsK8wP7zGMLdBPEg6kqduLVR5Befn6HDOGNu88H4OCtT1ybz2s5+eskI ftWY5+M0QDRAj1l+pSFTSpJAjz6MejEMqYYq9ClDHYB7ylTQRa72rqLQImZveyWqZPCS kRbxS8PGz7gbeosHBQqfBDHomPmM0fHyKyDm2iWpBChJOBPmerEJEwASw6SZWBK2Ik30 Di59nCqo8w86EY6NtJTEVkmMnlbQWwOUzE60ie/Zo/C9t45UKYDS33v5v69l58cbB2b2 Vfuh43RvuY/Fx5rZ60LWtrQqp0HRiZaeDQf9PyhtodPR1lW2iE2ULTG5B3tQYaaw0BRN 2GAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=FB66OVWl; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-172505-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172505-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p15-20020a05622a00cf00b0043aee9f3398si13033840qtw.55.2024.05.07.16.59.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:59:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172505-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=FB66OVWl; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-172505-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172505-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7EC6E1C21598 for ; Tue, 7 May 2024 23:59:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9382B13AD06; Tue, 7 May 2024 23:20:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="FB66OVWl" Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) (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 8931212BE80; Tue, 7 May 2024 23:20:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.98 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715124007; cv=none; b=Pn843AQun5nJK25kzNeZWMsFZymNvPNbut/z21WMujR6VAcp227n1NnGQsd0I+a4wKDgOcAo4pXBlhsuUC1gbgIS8WXtF4OwAv0I5/7JyNxJR0elKBSDuIjeCQBBQxivk9Z6Um2/gIYuY/nbrS85DQv+/N/sCUVoUhq8wLbjexw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715124007; c=relaxed/simple; bh=kHS9g9RwmKOf15zpnBSFQy0orV9EnY5jccmGnQvCJl0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=etBEq1fwnLcVkOTgDudGLpVyKCxIjj1BnYfJYveoBWvrjG7B0gxlQnY16WTGNseQ4aOcOH2zFyd8gnlBLnrjrK5eLNWPdYMLHwvOAsNUmUHmcr3X4cdJVvHUiM+DKYai8kuyU5ZMoSEf1VgCV2PLxj+mYe8Ep6UuZGoyEh2l+BM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=FB66OVWl; arc=none smtp.client-ip=115.124.30.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1715123996; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=e0zrxwPcAb6kwy18tLfS3CmdjXGu2j+7ybZ31BCE1es=; b=FB66OVWllglJrtsVgitdr4BBAFSOJsBaZztYNNhtXW8dxHbHjVUuAsWqekWUXTz3pCER7z9lCNl0lxrDvK160MtUtI1/+OsEI+yk/0tf7V3hCHytjVEztSDPszc58oMe9uiK5sG4CN9CveCAkN1Qzcoth2IuaKHjdBcSVfjVNu4= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067112;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0W61IPVB_1715123993; Received: from 30.25.231.12(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0W61IPVB_1715123993) by smtp.aliyun-inc.com; Wed, 08 May 2024 07:19:55 +0800 Message-ID: Date: Wed, 8 May 2024 07:19:52 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH AUTOSEL 6.8 26/52] erofs: reliably distinguish block based and fscache mode To: Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Greg Kroah-Hartman Cc: Christian Brauner , Baokun Li , Jingbo Xu , Chao Yu , xiang@kernel.org, linux-erofs@lists.ozlabs.org References: <20240507230800.392128-1-sashal@kernel.org> <20240507230800.392128-26-sashal@kernel.org> From: Gao Xiang In-Reply-To: <20240507230800.392128-26-sashal@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 2024/5/8 07:06, Sasha Levin wrote: > From: Christian Brauner > > [ Upstream commit 7af2ae1b1531feab5d38ec9c8f472dc6cceb4606 ] > > 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 > Signed-off-by: Sasha Levin Please help drop this patch for now too, you should backport the dependency commit 07abe43a28b2 ("erofs: get rid of erofs_fs_context") in advance. Otherwise it doesn't work and break the functionality. Thanks, Gao Xiang