Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp713532lqa; Sun, 28 Apr 2024 00:17:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDKzA6xAdZ9+OcNZRdBee+JNwuiYDNwmbK7Hv7VX+hjwKdhoa5Ssh7kNyU7cCcgj2JBvJRB1uOd5/jvCKjmpb6Wd1kwj+r3xEPQTehEg== X-Google-Smtp-Source: AGHT+IEUY7Pdf05MpKx+2G8EVcdu5UH+U+nuK9ZqcSpQgOHlNWG1Ioc1LxPyTjvoZI7bnKFc76iC X-Received: by 2002:a05:6808:1389:b0:3c5:f4b3:e0e3 with SMTP id c9-20020a056808138900b003c5f4b3e0e3mr9617465oiw.41.1714288669156; Sun, 28 Apr 2024 00:17:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714288669; cv=pass; d=google.com; s=arc-20160816; b=Zk9XbsQXvWctr5stkIkw+Nx0YRlzx7/1GD86kY9955nsRuXwYU2VU4r3axEqwo/WHv lFiY18dgRf2DDq9lQ3gPaT6id3H/R1E5XftGnH3c5SThggrl1jTuXSz3aY0Ye7IkfdGl p5BC4PygSqhNWupTC5GQwHhNvUX8PpLc7rSlbkcf2KZj7GH9tSPUVsKO30Cw6aNFdzoQ iRT2DfZ3FRfaLo0V3s9T8Sp/JNShJQFY8mVaYW1TKPE/pc7Hc4PjoWj9NyGOZtDWmLl/ JpwVXLczaXx44Wrxkk8YqVDp0SpTPVHQeE0l5F0G06vxLRnl33k3vQMXYKQjWujpAbvW rIvA== 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=ElM6MfNktHIzrhGINadeKp0SVn1/8qMDX9pmLKgfGNE=; fh=pGJXlUUwfQ/lb4L0fO0xG+2bn+SBfr/6/lfxF2CFhYM=; b=gDnD+MWVTwHaChXY4Up2x3PzwsBDoNrQv8H9aeepyDKHJ0XQ5mNdVAyCp4GiraNoij vvm+6iytf/i/J/xmV9870ly9muh7wZiyig0hl/PvQehOQiXULwOhIGNffUjENTtEsCvP NDSLqBgOwFbeUTJIJxNt94vExgLkDEFcwYeL1YwPonGw1A7/EnF37+7FsPqdkQ12lnOf BEuA4OJM9qIpdyCdmXxXmLN57mxsVlv1UOCh1/KdRfhVQ7+RLBKjIsXX9qucsKzFlPec MxEApadYmwhwdFnvOewAyblL87WVQW2pmbQ22iNb/a9ojVo3H+i3nzex63r6yiDNrmVw 2y2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=f0dWapUU; 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-161305-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161305-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 sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i6-20020a6561a6000000b005e838ba3449si18227657pgv.860.2024.04.28.00.17.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 00:17:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161305-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=f0dWapUU; 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-161305-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161305-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B7700280F8A for ; Sun, 28 Apr 2024 07:17:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6898D5026A; Sun, 28 Apr 2024 07:17:42 +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="f0dWapUU" Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (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 B1DF24F1E4 for ; Sun, 28 Apr 2024 07:17:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714288661; cv=none; b=sPIcETy8qz9p5I/yPwaWOnM1ubsdPt1oHtyBtX1Cyqj8FV75ewxyPPFKKIq2lOhrfRHSWsjjcjlOvTjiU3JJcEyyqqkoD8wsLoTFZzzNw2R+snqPu3/b2HidNF5uBdCgk6RSSAvcXIUsZfX5TzvjOKHnCcj5rw3wSV4wA26j06c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714288661; c=relaxed/simple; bh=gYY7v02S2zkJs5o/bwk1jVObM0FWr25UBqQ3c5f8Bvk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DWDC+PBeqehX1nwJ/BcaACi8F3rZUWH0MaOFboFUv+T4bjj9qgl4mGZfij3cuMfJX2iMzZbV48DotYoFTSfuFIo7x6TIl8lwAFuou4IeSV7IEpIdMXnAJEPeQrYzyZeVbbqqI5zpA2910yHJ9ZzD/WcW/2tuyzwF7DBvHTsCE3w= 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=f0dWapUU; arc=none smtp.client-ip=115.124.30.132 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=1714288656; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=ElM6MfNktHIzrhGINadeKp0SVn1/8qMDX9pmLKgfGNE=; b=f0dWapUUVt2eJuh2weIwbW39Bp2REuC0ZneLDtkNR7YEIpO/QcgtadA/yR5Qk+qxJykl8xWiE0QRHmoe5v+68eMEnckguwe8UX9mrMw6bM2afe0HupRDIfg+CESBvgVei641p/Pu7ojnAHPP86G4qROKI0OJ0pWhVZefDE+iQgY= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045046011;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0W5Nef7l_1714288653; Received: from 30.221.129.62(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0W5Nef7l_1714288653) by smtp.aliyun-inc.com; Sun, 28 Apr 2024 15:17:35 +0800 Message-ID: Date: Sun, 28 Apr 2024 15:17:33 +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 -next v3 2/2] erofs: reliably distinguish block based and fscache mode To: Baokun Li , linux-erofs@lists.ozlabs.org Cc: xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, viro@zeniv.linux.org.uk, brauner@kernel.org, linux-kernel@vger.kernel.org, yangerkun@huawei.com, houtao1@huawei.com References: <20240419123611.947084-1-libaokun1@huawei.com> <20240419123611.947084-3-libaokun1@huawei.com> From: Gao Xiang In-Reply-To: <20240419123611.947084-3-libaokun1@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/4/19 20:36, Baokun Li wrote: > From: Christian Brauner > > 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: Gao Xiang Thanks, Gao Xiang