Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp400112rdb; Thu, 19 Oct 2023 07:42:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDV3xOFgCAV1HjoPPVnLXbNfZHNs0W61agluRQfubKcbUAzI4CLlFPqI9kRepk6XCb4f8w X-Received: by 2002:a05:6a21:18e:b0:154:bfaf:a710 with SMTP id le14-20020a056a21018e00b00154bfafa710mr3182390pzb.41.1697726534527; Thu, 19 Oct 2023 07:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697726534; cv=none; d=google.com; s=arc-20160816; b=snIouM4usbqimI8ZHQB+o59D5nECCIK36Sba3t03lR7+yeG3zi8/DKOC2AzvpJn9ON dPr/un/IoO4Y46UIH+K8BYXJewjpuSk0P2/6CYQ3znF6VfJDWk7dEku2kTYtTr22zsgz oZFr1tJ/q1YjiSOFkDG1jno1zlBLElastvU1cKNCrphARXhFsAHbTeqP0cYoPy+7O3/1 RjlKlISqdzwNqBxdPDBdK8y6STipWeTdKv/n0lJoXPmhIM4/br3aHJbicdxIIDJbIFYJ tnmaCOFwEw0rEQ2+FQDxUgWAfom63hSGpwMd4ftSyROqN5WpBa6wQgDfU8lNgyDgOxOM 1VlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=giUtDebGC6NH2VxVmcfSKNOmZ8T50HmB+uU52TrCw5s=; fh=lDiGqg3gPmyeCipTkGF/rKa36svKb+zKwXdWWECJhIc=; b=IKfek/0lQVBJkTzrxja8rLgzTSSwdjYloXcDtB2X3M3BC9RmqR/ifDcirQYTJ/kuot fBYSg8DaJp38+HbTIcfeTlKxZqcCtKQgdpoeQdDo2CwSD+woUdKuHvCZZiTX4Qmr9OlX 3DIVzeCHWbrIPMucEhhB9ZkJLbsB59VXu/SXnSzwt7KZa4OhvccB+up7nJw8o7yJuR6n +1jd+82vw2KynfqoJK6IycfOoofeVBtfciReP6/eU5Es5MFoVZFMBTz0Qpgr6ecQO3th KbBv2YmnonVAXQwVNOgWvEIPAD4CEAeJD3qb0Gcg9vlliBMft+Wpy5psOin2QyT6KQfH BHjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="s3/NkTWM"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=F1DHfkkM; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k22-20020a634b56000000b005ae22729b09si4293573pgl.683.2023.10.19.07.42.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 07:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="s3/NkTWM"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=F1DHfkkM; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8CEB880E2265; Thu, 19 Oct 2023 07:41:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235418AbjJSOl6 (ORCPT + 99 others); Thu, 19 Oct 2023 10:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346232AbjJSOlX (ORCPT ); Thu, 19 Oct 2023 10:41:23 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E9E710D3; Thu, 19 Oct 2023 07:41:15 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 45DEF21A60; Thu, 19 Oct 2023 14:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1697726473; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=giUtDebGC6NH2VxVmcfSKNOmZ8T50HmB+uU52TrCw5s=; b=s3/NkTWMWcdC2YaKJScEK9z2CwoGs+34LvlukdkIbgzgmhJOypbE1F5tQu1CgN+e/SODY+ yVM1R8TakTBTpd8Kfu2OTLsyN9BAX1DSvHWkTxLaygzz1TlA58landeXMwKmdDwBVUfQ+z +SOND7nf19WVZHBtjO0mIIyC6qnAt2k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1697726473; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=giUtDebGC6NH2VxVmcfSKNOmZ8T50HmB+uU52TrCw5s=; b=F1DHfkkMuiKq0YZfVvVhiGNdbjG3MziNMFeVI2cSYkIflSvXsylQXbT11Hg7y2BdnUJC+S cr2n8RuwMwCA3zCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 36F5E1357F; Thu, 19 Oct 2023 14:41:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6ZJjDQlAMWXcCQAAMHmgww (envelope-from ); Thu, 19 Oct 2023 14:41:13 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id BA13FA06B0; Thu, 19 Oct 2023 16:41:12 +0200 (CEST) Date: Thu, 19 Oct 2023 16:41:12 +0200 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , Jeff Layton , Chuck Lever , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH 4/5] exportfs: define FILEID_INO64_GEN* file handle types Message-ID: <20231019144112.anbgoixxe2aol5s6@quack3> References: <20231018100000.2453965-1-amir73il@gmail.com> <20231018100000.2453965-5-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231018100000.2453965-5-amir73il@gmail.com> Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -6.60 X-Spamd-Result: default: False [-6.60 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-3.00)[-1.000]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_SEVEN(0.00)[7]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Thu, 19 Oct 2023 07:41:59 -0700 (PDT) On Wed 18-10-23 12:59:59, Amir Goldstein wrote: > Similar to the common FILEID_INO32* file handle types, define common > FILEID_INO64* file handle types. > > 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. > > 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). > > The FILEID_INO64_GEN fhandle type is going to be used for file ids for > fanotify from filesystems that do not support NFS export. > > Signed-off-by: Amir Goldstein Yeah, better than the plain numbers. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/fuse/inode.c | 7 ++++--- > include/linux/exportfs.h | 11 +++++++++++ > 2 files changed, 15 insertions(+), 3 deletions(-) > > 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, > } > > *max_len = len; > - return parent ? 0x82 : 0x81; > + return parent ? FILEID_INO64_GEN_PARENT : FILEID_INO64_GEN; > } > > static struct dentry *fuse_fh_to_dentry(struct super_block *sb, > @@ -1010,7 +1010,8 @@ static struct dentry *fuse_fh_to_dentry(struct super_block *sb, > { > struct fuse_inode_handle handle; > > - if ((fh_type != 0x81 && fh_type != 0x82) || fh_len < 3) > + if ((fh_type != FILEID_INO64_GEN && > + fh_type != FILEID_INO64_GEN_PARENT) || fh_len < 3) > return NULL; > > handle.nodeid = (u64) fid->raw[0] << 32; > @@ -1024,7 +1025,7 @@ static struct dentry *fuse_fh_to_parent(struct super_block *sb, > { > struct fuse_inode_handle parent; > > - if (fh_type != 0x82 || fh_len < 6) > + if (fh_type != FILEID_INO64_GEN_PARENT || fh_len < 6) > return NULL; > > parent.nodeid = (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 = 0x72, > > + /* > + * 64 bit inode number, 32 bit generation number. > + */ > + FILEID_INO64_GEN = 0x81, > + > + /* > + * 64 bit inode number, 32 bit generation number, > + * 64 bit parent inode number, 32 bit parent generation. > + */ > + FILEID_INO64_GEN_PARENT = 0x82, > + > /* > * 128 bit child FID (struct lu_fid) > * 128 bit parent FID (struct lu_fid) > -- > 2.34.1 > -- Jan Kara SUSE Labs, CR