Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp179800lqo; Tue, 7 May 2024 16:58:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBwKehyhGLgbHTAeZL8xILulaIq3Y5xrSyYgh/hwIj3nNff1nBUYsCnH5pCXngonjTUL8xyyIIQTNZ1B159VgL4BxuE/tOZ4Qx7A7IXQ== X-Google-Smtp-Source: AGHT+IFn5fSR3BD+m5z4dbMoJBvAxsOiZYcQoAKauq4dQySRE917CxhRfoPngAHvrckaXYCU5gA5 X-Received: by 2002:a05:620a:2626:b0:790:c6ef:3d0f with SMTP id af79cd13be357-792b285b800mr138636485a.54.1715126279823; Tue, 07 May 2024 16:57:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715126279; cv=pass; d=google.com; s=arc-20160816; b=djUv6u6PMLDf+3lEIdAgcNc5Tg3TlZm6t7/IoI/flJbBut6gdoGs/8RUtSg83UsmXa +qH9C/Q546tujrlOWAnAteRSA8FB4F5NPZjhPQPleRfaqTInPFMpNY7HAVofZiOlt5Cc USgZOtYVKvJ1wqnZT2d0MkEJQ+JDDOS58HxOa8Ivbhs3xRMd76PjUXvvaHbhGQlpGqV3 vTwZRz4dZc6skcJpUSukexRM8Tyc/a9SJpot9Hw1yhiwyOQiTJoxu3IhA5m/lzftUwNO 7Eq0Bzqj9QEWvEWnAewbx+MUz0nkm4CH0ZAF4Xfxjtdr/5KdqBd4HmmTv+V3+Dk6ZRAb e0Gw== 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=ot252tbl7SBLqukvaIH9QV/q4GG5yoGHVQJ2MVuayfg=; fh=sKZhVjPvNy3IR05b/28WmNEVQ0sdGrNlZYo+1UGeByI=; b=qPTpfNXB5I0/fskDLqRoCOvnhwIXtETinrEFhtyimSM6xKzU5QaDA55Tpk12io4Dpz aiK+65A+Etb+S14O1WQohqLPLN7s86i7gePRxUwN6quyxCc+ah/+l5tKJ6hwutqP/ttR Uv9VYmReGa1jgX68snE/KpGSc6FoLiuUCZjyt9T2+9mLuBZfSZQbTAL4ZgjIonmP4K7O SIsxPENiff0zJTBUXB2dQSy2cDcjIVkm9PoJrgD3dRsiuHArpuTZlXZH4T4GA2rB8XyY YXRGmj4y/oolSW78cSukRqvhZenTCeEJzxC1ikW0uk+wTqRfho0BE9ata9DzdiWwijsk /VRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=GDYRA7PX; 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-172499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172499-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 xz18-20020a05620a5e1200b00792908d87bcsi7572922qkn.284.2024.05.07.16.57.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:57:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172499-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=GDYRA7PX; 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-172499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172499-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 7DAB11C20359 for ; Tue, 7 May 2024 23:57:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79AC81A2C16; Tue, 7 May 2024 23:16:27 +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="GDYRA7PX" Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) (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 040F91A2C06; Tue, 7 May 2024 23:16:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.97 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123786; cv=none; b=O47M24ecYjpO5wgxAr/X+8prRSPkU6nJ+NoG9XgDMyFBiWsp74fkSI8kDZGTgvQwUb/vNaN+fW1tpDAHYDXOkwCEc+CboycPYKXT7SdbUVp2BOjIp7O6dBPohf5VEoUs86zNOyp2CSwn7gWBSmewASaNhS7/FIrHc6q7mQp4a3I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123786; c=relaxed/simple; bh=W4CvRIluG6tZP/2Olqj+oh3nl1PvWT5AaGD2q1molKc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tMB0J/MoOVvw5jq3EARweuu/Xn1v6VX7uO88paWSf74iGp5r4sf6eMOe500VXtRXN2/1A9TNSiGS+IYCkRaxacPMnmR4dUrpakD4FeVhknIHuynwU+l5VmFT2WxU4m/CfWd88jKREhT+y+V/NSiAR/22GxfiAmp4i17cz4WihdU= 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=GDYRA7PX; arc=none smtp.client-ip=115.124.30.97 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=1715123780; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=ot252tbl7SBLqukvaIH9QV/q4GG5yoGHVQJ2MVuayfg=; b=GDYRA7PX62xTD6CX6y0IbiRSSVXLxM7W905mUeY0+i7OK+8w4AdpN+l4kdlBf+5KH/tR2hr983Z3ujXv4Ioxk2UhUdIXPhJynWuQ8KRGk2KzvLISGeNAG1h42UUNVN7CnysJCLiNivj/QWs4yiK6ydEritLa8X3HvXOSwVP0sOU= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033022160150;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0W61JUjF_1715123777; Received: from 30.25.231.12(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0W61JUjF_1715123777) by smtp.aliyun-inc.com; Wed, 08 May 2024 07:16:19 +0800 Message-ID: Date: Wed, 8 May 2024 07:16:17 +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.6 21/43] erofs: reliably distinguish block based and fscache mode To: Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christian Brauner , Baokun Li , Jingbo Xu , Chao Yu , xiang@kernel.org, linux-erofs@lists.ozlabs.org References: <20240507231033.393285-1-sashal@kernel.org> <20240507231033.393285-21-sashal@kernel.org> From: Gao Xiang In-Reply-To: <20240507231033.393285-21-sashal@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 2024/5/8 07:09, 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, you should backport the dependency commit 07abe43a28b2 ("erofs: get rid of erofs_fs_context") in advance. Thanks, Gao Xiang