Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3840240rdg; Wed, 18 Oct 2023 07:33:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqmtFuLuxTspkA/9wd5j85QeCpAjFHRoGwqcUVn4lTX4Au8oyqp2SxL8sJ1I/3z2EcDGUr X-Received: by 2002:a17:902:e801:b0:1ca:8169:e850 with SMTP id u1-20020a170902e80100b001ca8169e850mr5800287plg.3.1697639582596; Wed, 18 Oct 2023 07:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697639582; cv=none; d=google.com; s=arc-20160816; b=sdw44AJqUWUSPBelMZpvujknxgIFBild9Oe2hhd9SX1TnWYPS3Ae7+ndRPYkYiMdyH gspm8eyyDfaDmnCPGu/uX5lgqzDQPbPLpj9MGI76GYzsc6D+DEDnYJfuAs6cj04MCERB +a3OlHouRtbl4gOsOX0jw368oeVVEGizXwPUOgQ2qWgCzNT0UhmlCNNnW2uaBjfhsXXl mpQlYaZwNZUIaJM6ujToRH9yaYQfdW3KEHHxEkqcdvZpsoHMQza9JtN2IJ49IkdlyvNL JZCJV2uhMKfpgy/uIFtp0eJuBhf91/mbhhmgTVJOM4WYqqtay4s5gjsvkC54l6m73GuF id6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=LaeL2i84X8g6vWbjW8qxowsd4vDuNx3Z6rxrK7i4V10=; fh=UhF25t0OeCAcCrVXPjAh8OFp6ZzVKN6UmHeNfp8T5po=; b=oezNT6z3o82eJ8ywmTZTfSFsREU8zS7aY9awhYooocN0GpPsEJg4wXrFZoUjEDiQOq 7DyMngtGL0wmiIJvX9JeSpTr8NqgplB4JRz7go44MG1TM9p6ergeOLMrEVbx0K1ox6C2 M+Z1bjbzLq9/3AQ14PrBG5mcCfNIjdO5aDWbzY2eKuYsWIVukk0rpUzBDpMB0BJEHH5z mI/XBGOTGfl4uIupypxHWEpFrgEj9BFXtAqyqa3nvqvhv9zbH5mnL0f2hD6luuS08Rgt ++c1LW0uwHGSEehemb+9dRozyWFWGoWqmh8KI8ggMT8mpmqjuExG/EjU7Z9ow2PXsDYk 9cfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=in80ri9d; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u15-20020a170903124f00b001ca81fa0660si4583024plh.496.2023.10.18.07.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 07:33:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=in80ri9d; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 46C1F802A3C7; Wed, 18 Oct 2023 07:32:46 -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 S235299AbjJROcp (ORCPT + 99 others); Wed, 18 Oct 2023 10:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345620AbjJROcc (ORCPT ); Wed, 18 Oct 2023 10:32:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7A8B6A4C for ; Wed, 18 Oct 2023 07:18:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F0BFC433C7; Wed, 18 Oct 2023 14:18:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697638685; bh=UB2hb8s5CEd3FPPIfnwCMCcqL6WX+kKb6T2In5KzbfY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=in80ri9duSGMlOA42NDLRVWiGWKWI1hoLO2QmWeLNj/jIvZ5lbrv7jmTfP8Tk0kUG CwyLBHEsmB0SnfD64r+zGIXAQEsWHt9urtYBoihNMBmXRr06JDIMwAamTYPY7pv3Qc j8f8LcsHfksAouIIB2JvIKMPcCbYlfbBmLeGHjYg5RXUya+NryZIgaqU47jcC1zeYB Qd8AHBA8jZ9xqsRty0odusQRmgQqrtn6E6QMkByNKd0cfq77ebbAjNCxMcmQK8n8m6 f9BNAD0kvuvQ4mzv14BErDYZoId3MS+LG2EQG1rQeUZJBuycxbde5648nmzT1qYscI uuuT4mW2XNY+w== Message-ID: <4106d2d1f94dcc992d6bd9b4d478f9a5588c6403.camel@kernel.org> Subject: Re: [PATCH 4/5] exportfs: define FILEID_INO64_GEN* file handle types From: Jeff Layton To: Amir Goldstein , Jan Kara Cc: Chuck Lever , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org Date: Wed, 18 Oct 2023 10:18:03 -0400 In-Reply-To: <20231018100000.2453965-5-amir73il@gmail.com> References: <20231018100000.2453965-1-amir73il@gmail.com> <20231018100000.2453965-5-amir73il@gmail.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 18 Oct 2023 07:32:46 -0700 (PDT) On Wed, 2023-10-18 at 12:59 +0300, Amir Goldstein wrote: > Similar to the common FILEID_INO32* file handle types, define common > FILEID_INO64* file handle types. >=20 > The type values of FILEID_INO64_GEN and FILEID_INO64_GEN_PARENT are the > values returned by fuse and xfs for 64bit ino encoded file handle types. >=20 > Note that these type value are filesystem specific and they do not define > a universal file handle format, for example: > fuse encodes FILEID_INO64_GEN as [ino-hi32,ino-lo32,gen] and xfs encodes > FILEID_INO64_GEN as [hostr-order-ino64,gen] (a.k.a xfs_fid64). >=20 > The FILEID_INO64_GEN fhandle type is going to be used for file ids for > fanotify from filesystems that do not support NFS export. >=20 > Signed-off-by: Amir Goldstein > --- > fs/fuse/inode.c | 7 ++++--- > include/linux/exportfs.h | 11 +++++++++++ > 2 files changed, 15 insertions(+), 3 deletions(-) >=20 > diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c > index 2e4eb7cf26fb..e63f966698a5 100644 > --- a/fs/fuse/inode.c > +++ b/fs/fuse/inode.c > @@ -1002,7 +1002,7 @@ static int fuse_encode_fh(struct inode *inode, u32 = *fh, int *max_len, > } > =20 > *max_len =3D len; > - return parent ? 0x82 : 0x81; > + return parent ? FILEID_INO64_GEN_PARENT : FILEID_INO64_GEN; > } > =20 > static struct dentry *fuse_fh_to_dentry(struct super_block *sb, > @@ -1010,7 +1010,8 @@ static struct dentry *fuse_fh_to_dentry(struct supe= r_block *sb, > { > struct fuse_inode_handle handle; > =20 > - if ((fh_type !=3D 0x81 && fh_type !=3D 0x82) || fh_len < 3) > + if ((fh_type !=3D FILEID_INO64_GEN && > + fh_type !=3D FILEID_INO64_GEN_PARENT) || fh_len < 3) > return NULL; > =20 > handle.nodeid =3D (u64) fid->raw[0] << 32; > @@ -1024,7 +1025,7 @@ static struct dentry *fuse_fh_to_parent(struct supe= r_block *sb, > { > struct fuse_inode_handle parent; > =20 > - if (fh_type !=3D 0x82 || fh_len < 6) > + if (fh_type !=3D FILEID_INO64_GEN_PARENT || fh_len < 6) > return NULL; > =20 > parent.nodeid =3D (u64) fid->raw[3] << 32; > diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h > index 6b6e01321405..21eeb9f6bdbd 100644 > --- a/include/linux/exportfs.h > +++ b/include/linux/exportfs.h > @@ -98,6 +98,17 @@ enum fid_type { > */ > FILEID_FAT_WITH_PARENT =3D 0x72, > =20 > + /* > + * 64 bit inode number, 32 bit generation number. > + */ > + FILEID_INO64_GEN =3D 0x81, > + > + /* > + * 64 bit inode number, 32 bit generation number, > + * 64 bit parent inode number, 32 bit parent generation. > + */ > + FILEID_INO64_GEN_PARENT =3D 0x82, > + > /* > * 128 bit child FID (struct lu_fid) > * 128 bit parent FID (struct lu_fid) Reviewed-by: Jeff Layton