Message ID | 20231026192830.21288-1-rdunlap@infradead.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp119155vqb; Thu, 26 Oct 2023 12:28:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMNi+BbNAtYsq75Pmr9+NWq7+123780GQ8U3W2LZAFCC1G3H48uGscqnp5QSaz8nrZNAWi X-Received: by 2002:a05:6808:4405:b0:3b5:37c6:6dcb with SMTP id eo5-20020a056808440500b003b537c66dcbmr55840oib.21.1698348539099; Thu, 26 Oct 2023 12:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698348539; cv=none; d=google.com; s=arc-20160816; b=fsVTcbITikh7/SmZmCcQ8gLexGPDyT6y1zg6J0gJuRpq3Cw03BOfb14bGbbwKxMhzr mbO31n3MLUOpC4p28mPYaGZFbFDoHpd30vriwmxKvRay/vr8NAIsm25hlEYx3qQ88gVT 0/3tlNjnytntu5j8J1sJtm74/eVPSMNCGHqVmM+SOew06Djv4uSth0KT1ksaVCXuGkEA XQF4oQf0menIwRDIs3vmFI6GLqzlxzYVQlPE89SskNipCCOy0tFCRZuWQ8+yrOD50AnP 4N40yjaxzY+B8aH26XyarhIhQgH1TbN8bLih3wBA8j+XgX+0iVL+VPBlDvJ4cjk5w51p 8OxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ToUeE8jlH67uNaR3XjokfMyr/EVi5kLp33HH0pq5Mw8=; fh=wmMDUrrXsf+ZO8uv1g80T9O9thvsUI8RGDGsdKYkzsw=; b=jMHn+1+pyRwsWwY1zwqY66sdMTp+wSUQk3eg9+PL974Ed9EZ+oHTqlEGtObMnQx5sD vnSagx5hU2wHgHdnU0c7kDf0NOGG0JGQu0VO56WKMug7/zKFrR9hhIgnYPcRBO5dLcnH WagZ5e4i/1Vi24/W4rYB/xFxaP5+G3CrbTaTlB6oD/GV3/1cHVcflpX+dBNXFzG4o6+Q OXqYSkUMt/9miMAzjrEBamvv5a1/sXfE7VYki26cI3v8HDPU0AINmkMG01DIipdL69Ug cGSR7cYUp6p69wRoe+QBCT6rvm/IWaLBnn+mtyWDDPAR7OrV991Mtfs9/+xtyANbMNzP Rk7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=iqcIoqmm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id c12-20020a25a2cc000000b00d9a4a89d97esi99161ybn.323.2023.10.26.12.28.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 12:28:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=iqcIoqmm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B73B68246332; Thu, 26 Oct 2023 12:28:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbjJZT2i (ORCPT <rfc822;aposhian.dev@gmail.com> + 26 others); Thu, 26 Oct 2023 15:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjJZT2h (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 26 Oct 2023 15:28:37 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F23C12A; Thu, 26 Oct 2023 12:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=ToUeE8jlH67uNaR3XjokfMyr/EVi5kLp33HH0pq5Mw8=; b=iqcIoqmmABN4vQb9TcuI7xO06L +9xFV3rGU763GNNot3CgGUyn+WkmnlNbr8mbozea7ydt8jdiXQZ0m+tYOky12mTbafLqqsjlHEzoF BnwOn8xyLYr5TM8zvHVJynk3A3Hz7uVKEwC8RZ1Qted1xgFfh60qyd6BlIO2TLZBNptCCKDlLzTIV Mh7GknNMLRGBx63gZKP0GlpFbeqLLx6ItYgSMSeDPuXPFnGnrLmcjv+DPnTYL9jWp41KLhDX6gwIn +SHh/XfQTlejFP/Fwt8I8WT602eJMks6DMO+Wx0Y+kiPRge6nYQFeIfj66G15thQ3kdI75NWJAwiA 9oQfp6KQ==; Received: from [50.53.46.231] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qw61v-00F3QG-00; Thu, 26 Oct 2023 19:28:31 +0000 From: Randy Dunlap <rdunlap@infradead.org> To: linux-kernel@vger.kernel.org Cc: Randy Dunlap <rdunlap@infradead.org>, Chuck Lever <chuck.lever@oracle.com>, Jeff Layton <jlayton@kernel.org>, linux-nfs@vger.kernel.org, Amir Goldstein <amir73il@gmail.com>, Christian Brauner <brauner@kernel.org>, Alexander Viro <viro@zeniv.linux.org.uk>, linux-fsdevel@vger.kernel.org Subject: [PATCH] exportfs: handle CONFIG_EXPORTFS=m also Date: Thu, 26 Oct 2023 12:28:30 -0700 Message-ID: <20231026192830.21288-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 26 Oct 2023 12:28:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780847517978779032 X-GMAIL-MSGID: 1780847517978779032 |
Series |
exportfs: handle CONFIG_EXPORTFS=m also
|
|
Commit Message
Randy Dunlap
Oct. 26, 2023, 7:28 p.m. UTC
When CONFIG_EXPORTFS=m, there are multiple build errors due to
the header <linux/exportfs.h> not handling the =m setting correctly.
Change the header file to check for CONFIG_EXPORTFS enabled at all
instead of just set =y.
Fixes: dfaf653dc415 ("exportfs: make ->encode_fh() a mandatory method for NFS export")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: linux-nfs@vger.kernel.org
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
---
include/linux/exportfs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Oct 26, 2023 at 10:28 PM Randy Dunlap <rdunlap@infradead.org> wrote: > > When CONFIG_EXPORTFS=m, there are multiple build errors due to > the header <linux/exportfs.h> not handling the =m setting correctly. > Change the header file to check for CONFIG_EXPORTFS enabled at all > instead of just set =y. > > Fixes: dfaf653dc415 ("exportfs: make ->encode_fh() a mandatory method for NFS export") > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > Cc: Chuck Lever <chuck.lever@oracle.com> > Cc: Jeff Layton <jlayton@kernel.org> > Cc: linux-nfs@vger.kernel.org > Cc: Amir Goldstein <amir73il@gmail.com> > Cc: Christian Brauner <brauner@kernel.org> > Cc: Alexander Viro <viro@zeniv.linux.org.uk> > Cc: linux-fsdevel@vger.kernel.org > > --- > include/linux/exportfs.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff -- a/include/linux/exportfs.h b/include/linux/exportfs.h > --- a/include/linux/exportfs.h > +++ b/include/linux/exportfs.h > @@ -314,7 +314,7 @@ extern struct dentry *exportfs_decode_fh > /* > * Generic helpers for filesystems. > */ > -#ifdef CONFIG_EXPORTFS > +#if IS_ENABLED(CONFIG_EXPORTFS) > int generic_encode_ino32_fh(struct inode *inode, __u32 *fh, int *max_len, > struct inode *parent); > #else Thanks for the fix, but Arnd reported that this fix could cause a link issue in some configuration - I did not verify. I would much rather turn EXPORTFS into a bool config and avoid the unneeded build test matrix. See comparison to the amount of code of EXPORTFS to BUFFER_HEAD and FS_IOMAP code which are bool: ~/src/linux$ wc -l fs/exportfs/*.c 636 fs/exportfs/expfs.c ~/src/linux$ wc -l fs/buffer.c fs/mpage.c 3164 fs/buffer.c 685 fs/mpage.c 3849 total ~/src/linux$ wc -l fs/iomap/*.c 2002 fs/iomap/buffered-io.c 754 fs/iomap/direct-io.c 124 fs/iomap/fiemap.c 97 fs/iomap/iter.c 104 fs/iomap/seek.c 195 fs/iomap/swapfile.c 13 fs/iomap/trace.c 3289 total Thanks, Amir.
On Thu, Oct 26, 2023 at 10:46:06PM +0300, Amir Goldstein wrote: > I would much rather turn EXPORTFS into a bool config > and avoid the unneeded build test matrix. Yes. Especially given that the defaul on open by handle syscalls require it anyway.
On Fri, Oct 27, 2023 at 9:01 AM Christoph Hellwig <hch@infradead.org> wrote: > > On Thu, Oct 26, 2023 at 10:46:06PM +0300, Amir Goldstein wrote: > > I would much rather turn EXPORTFS into a bool config > > and avoid the unneeded build test matrix. > > Yes. Especially given that the defaul on open by handle syscalls > require it anyway. Note that those syscalls depend on CONFIG_FHANDLE and the latter selects EXPORTFS. Nevertheless, the EXPORTFS=m config seems useless. I will send a patch to change it. The bigger issue is that so many of the filesystems that use the generic export ops do not select EXPORTFS, so it's easier to leave the generic helper in libfs.c as Arnd suggested. Thanks, Amir.
On Fri, Oct 27, 2023 at 09:11:57AM +0300, Amir Goldstein wrote: > On Fri, Oct 27, 2023 at 9:01 AM Christoph Hellwig <hch@infradead.org> wrote: > > > > On Thu, Oct 26, 2023 at 10:46:06PM +0300, Amir Goldstein wrote: > > > I would much rather turn EXPORTFS into a bool config > > > and avoid the unneeded build test matrix. > > > > Yes. Especially given that the defaul on open by handle syscalls > > require it anyway. > > Note that those syscalls depend on CONFIG_FHANDLE and the latter > selects EXPORTFS. Yes, this means that for all somewhat sane configfs exportfs if always built in anyway. And for the ones where it isn't because people are concerned about micro-optimizing kernel size, nfsd is unlikely to be built in either. > The bigger issue is that so many of the filesystems that use the > generic export ops do not select EXPORTFS, so it's easier to > leave the generic helper in libfs.c as Arnd suggested. Agreed.
diff -- a/include/linux/exportfs.h b/include/linux/exportfs.h --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h @@ -314,7 +314,7 @@ extern struct dentry *exportfs_decode_fh /* * Generic helpers for filesystems. */ -#ifdef CONFIG_EXPORTFS +#if IS_ENABLED(CONFIG_EXPORTFS) int generic_encode_ino32_fh(struct inode *inode, __u32 *fh, int *max_len, struct inode *parent); #else