Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1401884rdb; Sat, 23 Dec 2023 05:32:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQN/E6v6kTBZZTBzUHC8Hodcrotc5MLsnse4YzdvapIuv3FE0wA47b+p1U4kLfyX1mY6cO X-Received: by 2002:a17:906:46db:b0:a22:fe55:f50c with SMTP id k27-20020a17090646db00b00a22fe55f50cmr1620084ejs.26.1703338350004; Sat, 23 Dec 2023 05:32:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703338349; cv=none; d=google.com; s=arc-20160816; b=bH91AFTX5Qmipv/QFNz9l8+goPmMjAnpmDL4Ysu9mA7H0B75V1DGeEFFZd3fSP9HVb DHXyFO4slJZhBtxtsw9DqLqiE2L1WHbqMZ0unERkUp+gjGss8IvE0XY69uu5+ORQA4JK TXLzhdXLxaK3wiJwdiCxKk4qV/K7pNsxfxEzyoc5d035/qprCnh3UDkpDMz+0DWrzN3V f8tYP8y1n53KbcCvN8tkHj1bcyUvLz0ynsfP4dKHoYjoZaPp7i5w76872tEmHT8Ie9+T xFpceUwrk4bPDmUDd99MGiZ3C6qebH+Fxin/cPAj4Q0rVXA+5oTGUB71zhpGBE9RaCqc bK3Q== ARC-Message-Signature: i=1; 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; bh=mHtLgD4vL+XswVBYByVqVHM5FfBvinzzdh5hkBKfVE8=; fh=at6sTlwsco5lvpfZ8jI/x7lZGurq4GevZwAdgJcl/6I=; b=bwkzwHg77WcYcyhu3z95h/VvWvwiR/5yFxv1ldraqGpO1Ao41OU0WETMUyKA6YAHEB qS4pLDpdi5BHrs7Wg8duITe/4fw8C8IM0vdDktqwvh/10Bbe+keeQ5nk2BF61w4sAUxv PWHVjxs9IAMLS2TY2SZwf7Cx5aV5eiQa964dUwynW3NxP/TFfCvBxlI2lX9JFPDG5LBp WewDkL8hoo9BGufv7gfCzGunlHycbugjot/JcOOcJY3PzABoy5lTyMFsgJUWPqmvwXCV 0E+UwraH9sUYcs1e+jeLTva7vD8NxhXbp3C6kqa3CrisbkHcjJ+qBEhNzFFwBMdmuH6F ZTqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs+bounces-783-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v6-20020a1709064e8600b00a2693aa088bsi2889024eju.563.2023.12.23.05.32.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Dec 2023 05:32:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-783-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs+bounces-783-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id B15271F2199D for ; Sat, 23 Dec 2023 13:32:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBF33D300; Sat, 23 Dec 2023 13:32:25 +0000 (UTC) X-Original-To: linux-nfs@vger.kernel.org Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) (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 858E4D505; Sat, 23 Dec 2023 13:32:21 +0000 (UTC) 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 X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=27;SR=0;TI=SMTPD_---0Vz1O0tF_1703338328; Received: from 30.25.242.252(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Vz1O0tF_1703338328) by smtp.aliyun-inc.com; Sat, 23 Dec 2023 21:32:11 +0800 Message-ID: Date: Sat, 23 Dec 2023 21:32:07 +0800 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fix EROFS Kconfig To: Jingbo Xu , David Howells , Gao Xiang Cc: Chao Yu , Yue Hu , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Dominique Martinet , Eric Van Hensbergen , Ilya Dryomov , Christian Brauner , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, Jeff Layton References: <20231221132400.1601991-5-dhowells@redhat.com> <20231221132400.1601991-1-dhowells@redhat.com> <2265065.1703250126@warthog.procyon.org.uk> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi David and Jingbo, On 2023/12/23 11:55, Jingbo Xu wrote: > Hi, > > On 12/22/23 9:02 PM, David Howells wrote: >> This needs an additional change (see attached). >> >> diff --git a/fs/erofs/Kconfig b/fs/erofs/Kconfig >> index 1d318f85232d..1949763e66aa 100644 >> --- a/fs/erofs/Kconfig >> +++ b/fs/erofs/Kconfig >> @@ -114,7 +114,8 @@ config EROFS_FS_ZIP_DEFLATE >> >> config EROFS_FS_ONDEMAND >> bool "EROFS fscache-based on-demand read support" >> - depends on CACHEFILES_ONDEMAND && (EROFS_FS=m && FSCACHE || EROFS_FS=y && FSCACHE=y) >> + depends on CACHEFILES_ONDEMAND && FSCACHE && \ >> + (EROFS_FS=m && NETFS_SUPPORT || EROFS_FS=y && NETFS_SUPPORT=y) >> default n >> help >> This permits EROFS to use fscache-backed data blobs with on-demand >> > > Thanks for the special reminder. I noticed that it has been included in > this commit[*] in the dev tree. > > [*] > https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit/?h=netfs-lib&id=7472173cc3baf4a0bd8c803e56c37efdb8388f1c > > > Besides I noticed an issue when trying to configure EROFS_FS_ONDEMAND. > The above kconfig indicates that EROFS_FS_ONDEMAND depends on > NETFS_SUPPORT, while NETFS_SUPPORT has no prompt in menuconfig and can > only be selected by, e.g. fs/ceph/Kconfig: > > config CEPH_FS > select NETFS_SUPPORT > > IOW EROFS_FS_ONDEMAND will not be prompted and has no way being > configured if NETFS_SUPPORT itself is not selected by any other filesystem. > > > I tried to fix this in following way: > > diff --git a/fs/erofs/Kconfig b/fs/erofs/Kconfig > index 1949763e66aa..5b7b71e537f1 100644 > --- a/fs/erofs/Kconfig > +++ b/fs/erofs/Kconfig > @@ -5,6 +5,7 @@ config EROFS_FS > depends on BLOCK > select FS_IOMAP > select LIBCRC32C > + select NETFS_SUPPORT if EROFS_FS_ONDEMAND > help > EROFS (Enhanced Read-Only File System) is a lightweight read-only > file system with modern designs (e.g. no buffer heads, inline > @@ -114,8 +115,10 @@ config EROFS_FS_ZIP_DEFLATE > > config EROFS_FS_ONDEMAND > bool "EROFS fscache-based on-demand read support" > - depends on CACHEFILES_ONDEMAND && FSCACHE && \ > - (EROFS_FS=m && NETFS_SUPPORT || EROFS_FS=y && > NETFS_SUPPORT=y) > + depends on EROFS_FS > + select FSCACHE > default n > help > This permits EROFS to use fscache-backed data blobs with on-demand > > > But still the dependency for CACHEFILES_ONDEMAND and CACHEFILES can not > be resolved. Though CACHEFILES is not a must during the linking stage > as EROFS only calls fscache APIs directly, CACHEFILES is indeed needed > to ensure that the EROFS on-demand functionality works at runtime. > > If we let EROFS_FS_ONDEMAND select CACHEFILES_ONDEMAND, then only > CACHEFILES_ONDEMAND will be selected while CACHEFILES can be still N. > Maybe EROFS_FS_ONDEMAND needs to selct both CACHEFILES_ONDEMAND and > CACHEFILES? I think the main point here is that we don't have an explicit menuconfig item for either netfs or fscache directly. In principle, EROFS ondemand feature only needs fscache "volume and cookie" management framework as well as cachefiles since they're all needed to manage EROFS cached blobs, but I'm fine if that needs NETFS_SUPPORT is also enabled. If netfs doesn't have a plan for a new explicit menuconfig item for users to use, I think we have to enable as below: diff --git a/fs/erofs/Kconfig b/fs/erofs/Kconfig index 1d318f85232d..fffd3919343e 100644 --- a/fs/erofs/Kconfig +++ b/fs/erofs/Kconfig @@ -114,8 +114,11 @@ config EROFS_FS_ZIP_DEFLATE config EROFS_FS_ONDEMAND bool "EROFS fscache-based on-demand read support" - depends on CACHEFILES_ONDEMAND && (EROFS_FS=m && FSCACHE || EROFS_FS=y && FSCACHE=y) - default n + depends on EROFS_FS + select NETFS_SUPPORT + select FSCACHE + select CACHEFILES + select CACHEFILES_ONDEMAND help This permits EROFS to use fscache-backed data blobs with on-demand read support. -- 2.39.3 But cachefiles won't be complied as modules anymore. Does it sounds good? Thanks, Gao Xiang