Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp429524rdb; Thu, 19 Oct 2023 08:23:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUE2rCu2Hy7zS5/E6V/0TCPaIdMQ4fH8yFyegP1/PTPAkZqIHNRCRF3zs9oGm6dIUCSiDN X-Received: by 2002:a17:90a:fd17:b0:27d:24ec:4fcf with SMTP id cv23-20020a17090afd1700b0027d24ec4fcfmr2182237pjb.22.1697728982511; Thu, 19 Oct 2023 08:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697728982; cv=none; d=google.com; s=arc-20160816; b=duak6MC1nqHNeKjMS+KeC75cf2+aOmOSTrg0syZqbhOogT/uO7zZg2iaLg3stYJpNp 8nKTkOG2LqpoMJhVZEFhxKlsXoxq1yCQ3AeoJyA7XyCLMwBwBmVfolpozpm8WkRL2ItR 2z1LUumHceJhcMzHQQpFD/QMMcbebQj5o7jnkzFm81gseozXOY0Xy2Wy2yWpGIO1+KDV j3GUcoWX0skZy+Fatq/MX/Vty1pCXRF91sM+kdO43wOUNQmWOLcDYgX0Z55Xv6z/xmvU dROVqhbx+ypOTOcmJr1z00clvj6cDhKsbeoz2KcxCRIjNL+so7Z0o6ZRWW6lzxJcRndc V+cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MTokfEhHW21by/jO57PLAHs5gEsNWQ+7mMyGsbJSujo=; fh=mDH7ACs1gNLY/fFhPDXcIe+p54m6i8R4YvAlfFKmxpM=; b=G2gnMMPI2WM3je1q1Q7bo1jtGJU911Xgx8XsR/hZjvjuM2Hljj0MicjJtspFqHd7jH FS1akFVoGWtLNgyJYFhiF1hKho/OqgVsPxyI77sP5Fvmey4pdIWsYY5p2ltRqc5zugPl DbOg4+QukBp2Ny76Mi3N8ffQTEcnTCaTm0G2c5JApoe5nwhFx6U0MZ0c49+dYC+e+xps dI0sEWTVUX4l8Dc9oPmyCsCqIct7AJWyMmtUsw8fPPLlNjzQ8i9p37JDHFxj5V94GP2w JVym/5T//HfZRqu3xCGS59TCkGBFveLAZqdTsa/aVfxiKKDYjEHpWXhXIUGoBsSzHaSU TrUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q0Uk+E7u; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id in8-20020a17090b438800b0027da14d150esi2173618pjb.187.2023.10.19.08.23.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 08:23:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q0Uk+E7u; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B247881A1B95; Thu, 19 Oct 2023 08:22:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233195AbjJSPW6 (ORCPT + 99 others); Thu, 19 Oct 2023 11:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232938AbjJSPW5 (ORCPT ); Thu, 19 Oct 2023 11:22:57 -0400 Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F97911F; Thu, 19 Oct 2023 08:22:55 -0700 (PDT) Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-66cfd874520so52084986d6.2; Thu, 19 Oct 2023 08:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697728974; x=1698333774; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MTokfEhHW21by/jO57PLAHs5gEsNWQ+7mMyGsbJSujo=; b=Q0Uk+E7uwUjGflczioeyrUni/DzpQn6ki8ZeJEmhpPRN+FCs7pA+iEW1vXz6cQBtOD tlW2s7Y5k2kydfVHlMD7l7gMcPmoqR5LdthziBfljecf+SGw2qDAqwMJvBZtNQNY193T LNiz3CfsjrjTYxiusqHPDCNujr4PFbDBu2MOHVugEcEqBzsSeVvMKBMBoINNPjGHXyD6 ggDwj8WJ20Rp2Wa7vJVSOZ1qvcEQCbq8tgeHY7wNWP7bqmIr27M2HzF66H5EaLM/heKN 0kTOKdezw2MLtgRjhWlCr+j8+pAFr4sFw+M2+4trnQHupkhpdWU/IT5oRjeVnr7u9J6t qp+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697728974; x=1698333774; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MTokfEhHW21by/jO57PLAHs5gEsNWQ+7mMyGsbJSujo=; b=uvI8Fz2LnlpYbYt8mDKzrkbMoNOCftGgC9Y3zelIzXFC06Rk7YBr9eXZti7opsmD0D AOaLANKHmlc7mQVMR7TXmzR12BDlrb9FwclpGGdviso2u4qxhffHvI6TB6t+iYe0hF5k GQipYJicC74IfNHqMluBxQFOoaisqplqzskjEyzOpQzNvnTXc4y6+VBTa4QqyTEVDYc6 2LK/M7yNDOQcAx8GqEMWhDQL1IIR2UviVlUk06JqczC2WsejsgqkKdPLRBzv1tLPgIxz YRAXAtU68GsJV6KObm9RRpL8tUBY1NnMzEjJ1OlkYlKTW/6uV09mCzeukQRwARcRfHG5 YnMA== X-Gm-Message-State: AOJu0YxfjH4+r474FYKVYjnGVAjq+cUeA0ffmCmO7y7ifaRHoBlUxUwO aeJdOkRTmFmBwUepoke1xtTMfZI1vvP41cUNqR4= X-Received: by 2002:ad4:5f05:0:b0:66d:17a2:34cc with SMTP id fo5-20020ad45f05000000b0066d17a234ccmr2617117qvb.64.1697728974033; Thu, 19 Oct 2023 08:22:54 -0700 (PDT) MIME-Version: 1.0 References: <20231018100000.2453965-1-amir73il@gmail.com> <20231018100000.2453965-4-amir73il@gmail.com> <20231019144026.2qypsldg5hlca5zc@quack3> In-Reply-To: <20231019144026.2qypsldg5hlca5zc@quack3> From: Amir Goldstein Date: Thu, 19 Oct 2023 18:22:42 +0300 Message-ID: Subject: Re: [PATCH 3/5] exportfs: make ->encode_fh() a mandatory method for NFS export To: Jan Kara Cc: Jeff Layton , Chuck Lever , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, David Sterba , Luis de Bethencourt , Salah Triki , Gao Xiang , Chao Yu , "Theodore Ts'o" , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Dave Kleikamp , David Woodhouse , Richard Weinberger , Anton Altaparmakov , Konstantin Komarov , Steve French , Phillip Lougher , Evgeniy Dushistov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 08:22:59 -0700 (PDT) On Thu, Oct 19, 2023 at 5:40=E2=80=AFPM Jan Kara wrote: > > On Wed 18-10-23 12:59:58, Amir Goldstein wrote: > > export_operations ->encode_fh() no longer has a default implementation = to > > encode FILEID_INO32_GEN* file handles. > > > > Rename the default helper for encoding FILEID_INO32_GEN* file handles t= o > > generic_encode_ino32_fh() and convert the filesystems that used the > > default implementation to use the generic helper explicitly. > > > > This is a step towards allowing filesystems to encode non-decodeable fi= le > > handles for fanotify without having to implement any export_operations. > > > > Signed-off-by: Amir Goldstein > > Just one typo cleanup. Also I agree we need a "nop" variant of > generic_encode_ino32_fh() or move this to fs/libfs.c like e.g. > generic_fh_to_dentry(). > I did this: /* * Generic helpers for filesystems. */ +#ifdef CONFIG_EXPORTFS +int generic_encode_ino32_fh(struct inode *inode, __u32 *fh, int *max_len, + struct inode *parent); +#else +#define generic_encode_ino32_fh NULL +#endif I like it better than moving to fs/libfs.c, because if CONFIG_EXPORTFS is not defined, no code should be calling generic_encode_ino32_fh(). It might be a good idea to define exportfs_can_*() helpers to false when CONFIG_EXPORTFS is not defined, but at least for fanotify, this is not relevant because fanotify selects EXPORTFS. > > diff --git a/Documentation/filesystems/porting.rst b/Documentation/file= systems/porting.rst > > index 4d05b9862451..197ef78a5014 100644 > > --- a/Documentation/filesystems/porting.rst > > +++ b/Documentation/filesystems/porting.rst > > @@ -1045,3 +1045,12 @@ filesystem type is now moved to a later point wh= en the devices are closed: > > As this is a VFS level change it has no practical consequences for fil= esystems > > other than that all of them must use one of the provided kill_litter_s= uper(), > > kill_anon_super(), or kill_block_super() helpers. > > + > > +--- > > + > > +**mandatory** > > + > > +export_operations ->encode_fh() no longer has a default implementation= to > > +encode FILEID_INO32_GEN* file handles. > > +Fillesystems that used the default implementation may use the generic = helper > ^^^ Filesystems > Thanks! Amir.