Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3876591rdg; Wed, 18 Oct 2023 08:26:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH760ggdFikP044mgvt/UrD8KDuKhGKeHpmNlS+3SOi727aamuvCf8+yKrTlXO+lTXwRf3H X-Received: by 2002:a05:6830:16ce:b0:6b7:518a:1672 with SMTP id l14-20020a05683016ce00b006b7518a1672mr5529047otr.34.1697642818340; Wed, 18 Oct 2023 08:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697642818; cv=none; d=google.com; s=arc-20160816; b=fr3Cc5Vv2bFBC0vE4AZIgbBJfoo/cULko1oJaU+BwUoXInkwAkq5p5tWhVqO/pxTNS 03/Q+CrMjD++8Y95yL8MZLSmm5CEw+hGtFEa8G4d14rKVdI4PCBGKqapsRC0QzfCK+15 uPSj1Ut5tkjvE9ocj273MK3SXu7z/YoI59Q4nRJy8OB8/Pr/rDCXVm/wO3HoOagPmxuU CrjZXF7A2Sbtb3IAxQjhZ1NDbVpJkM1ouf5y+WE/a4UFCpbFS+DhGzxLK7s4rZw7QE8Z HzFmJIPpgc1D98W95XzOyiqATI5goW0F9H1tXZg3WceeOyNnBJBCgxHchCySZ2p92gEa akrQ== 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=vqR4hGhc1859l/BnMFSlg9BknGLMflshjjSUP4qtEr8=; fh=L6u8Zk+B07KmzCWZ/3kGYzYdIdo987xQLkBFSm1vqFk=; b=htry6D4kFUnr/2tRz4eau0kSIw+CqI5owSigW2QHWWOoMLBl6L91/UN+Mqki/DcJLy 7pK4EwJQUKnDcD/00q27z0KTUT5kDzWdtqhagFxOAIWJWgqptpJRSLkQoZ9nDQIR5jbA sGx6WaqdzXzZp9WRog9LaK8bohz32fN/TE2e9E27ZCStnhlSqvOTGm/AqjojBNtciM8i 8qRRoERrhESgjZddv8pawnMJ0kDNuc+7Yf+uCiTkgo+fM8ShQpBln0DTT8qvRwn60mDN tc+dM9G6ss0ogox7GOVdkMxZ0nuFFx5y9pQzEPQ0Mp5lXyloeRZRkeCrz1oy3HRSarh1 40VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KHNiYF2E; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x2-20020a656aa2000000b00584e731e7fbsi2095696pgu.280.2023.10.18.08.26.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:26:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KHNiYF2E; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 2403B804921E; Wed, 18 Oct 2023 08:26:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231472AbjJRP0V (ORCPT + 99 others); Wed, 18 Oct 2023 11:26:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231488AbjJRP0V (ORCPT ); Wed, 18 Oct 2023 11:26:21 -0400 Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18A5A98; Wed, 18 Oct 2023 08:26:19 -0700 (PDT) Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-66d2f3bb312so33913586d6.0; Wed, 18 Oct 2023 08:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697642778; x=1698247578; 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=vqR4hGhc1859l/BnMFSlg9BknGLMflshjjSUP4qtEr8=; b=KHNiYF2E00vbvUMzNgqdyxIFiPF6fmXOfVxpqqFCJ6Ye6HV2OulILEDorrvyY4cBjp 0IEXy/e034O2d4oN0acAE4rooHOUDUq35tnpNDykQ/JNPEnFR1G+GPNKzBcBKmDwZWGt 6tXha0aaaQTy0pR6ulMOOStqDAIG3tqcxgv2EsbnticvYNrjJYJfXBBRf9X3TPiZdYBP Z/uLbwGC8LXkX8RokoDZori8lZ6xbVAf1vGUROBWrcYh6WwTOt3Mum+jG6fcoHFqFnoE 2ntYrOAfidJTdiJog3MqSdPZijGopKJvVaK4+9q5E2XBybHdbezX1CoJQBT/yfSsDSCw ThXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697642778; x=1698247578; 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=vqR4hGhc1859l/BnMFSlg9BknGLMflshjjSUP4qtEr8=; b=ibwSsr25u+GRLgBYFhKPO9N8vvp8AtBQb9Jgixsg0Vsj1fmt+g9kiihjqU1EGdmsEL GDOSvqn87CxWbh0QKVL5ktj6c4nZQrzEWZovmjdiS1UUgK40+dezR+MUaaq+g/UWb2Zr fQiVdDNZqN2oDV9qazWc+Cfx46rmdCHTIuCFqz5PcSg4b32pzXggXoO2YkSYsYBI5wr2 5hYmH9py9hi9HRCyDDVv5ZCNG2YwZKOFMcM2s6zOZVzy+yklgy74zToMEiOR//kHs/2e +MhJrm/LVCRncXgaUYKQ5pT6diQskD8kJ7XKqDwgNzPdLSNnYsfB5tEyYKd46GtIGWE5 lMGA== X-Gm-Message-State: AOJu0YwGIIqJ/KtVsWztL0B9/frWyG5bhXi1EfTYkEG6b5cHEHEcDKQM mKTXQmOdmp82CT/m8Hgd01OCkKH5iPh0PIZWfZc= X-Received: by 2002:a05:6214:c6b:b0:66d:63f8:255f with SMTP id t11-20020a0562140c6b00b0066d63f8255fmr6962139qvj.56.1697642778154; Wed, 18 Oct 2023 08:26:18 -0700 (PDT) MIME-Version: 1.0 References: <20231018100000.2453965-1-amir73il@gmail.com> <20231018100000.2453965-4-amir73il@gmail.com> In-Reply-To: From: Amir Goldstein Date: Wed, 18 Oct 2023 18:26:07 +0300 Message-ID: Subject: Re: [PATCH 3/5] exportfs: make ->encode_fh() a mandatory method for NFS export To: Chuck Lever Cc: Jan Kara , Jeff Layton , 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 18 Oct 2023 08:26:33 -0700 (PDT) On Wed, Oct 18, 2023 at 6:18=E2=80=AFPM Chuck Lever wrote: > > On Wed, Oct 18, 2023 at 12:59:58PM +0300, 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 > > --- [...] > > diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h > > index 5b3c9f30b422..6b6e01321405 100644 > > --- a/include/linux/exportfs.h > > +++ b/include/linux/exportfs.h > > @@ -235,7 +235,7 @@ extern int exportfs_encode_fh(struct dentry *dentry= , struct fid *fid, > > > > static inline bool exportfs_can_encode_fid(const struct export_operati= ons *nop) > > { > > - return nop; > > + return nop && nop->encode_fh; > > The ->encode_fh() method returns an integer type, not a boolean. It > would be more clear if this were written > > return nop && (nop->encode_fh !=3D FILEID_ROOT); > > (I'm just guessing at what you might have intended). > You must be pre-coffee ;) This checks if the method exists, it doesn't invoke the method. Thanks, Amir.