Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2600174rda; Wed, 25 Oct 2023 07:22:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhaP3/kvR8lHXhKNUavHfo6GOmgyS62t3iI55SfJ/nHCmlFhBf0+J++4J1YwwjrFLuh/CX X-Received: by 2002:a05:6830:1da8:b0:6cd:941:418c with SMTP id z8-20020a0568301da800b006cd0941418cmr15863158oti.21.1698243731479; Wed, 25 Oct 2023 07:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698243731; cv=none; d=google.com; s=arc-20160816; b=biwUubIgkyw//0BMnp8QMuMxxOlR93rbacaW43lcq3SomHmDiYnw1EJz/FzPpgrwkD R0Z0UtDFEA0zlC8bsApxPt5jJxGTT2+ymPZtYtWcS9Aya2AJvZscB4k9VmJOx5yKrcqr xc8H53qQHscasa9mQgBYQf7QU+VB+7oh5VvT7PdppJsrdDdL0zFnip3gptK5heSWSJRj kwQqDPRzVguclQt55VLI3S4zrAI1ZWKTnAkulPDh/oVtvCuymg9NxZJo0SUXOwPfH51H 7ngwjW5TRgW3sP7oGyk+asCJ4cuoZ+V4uLfPWIiEGsu37gu/154+Sx2Kd995fPM0dmGm tPrw== 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=6m+wqEMlZRmmaiTawtcjDnjRXGd+ey2+AQbrwr0QEjw=; fh=romkrmNBjIt55CnmF+L5/caLd/t5+d41/GsjEYbV1AM=; b=juRI4QvtSTmyNRlcemVADxck+/5+51CJoosivmbGKb6sTTRwk5M7DkZ5ICdaZSWMTm /zQueK26sxDoGUeWCX9TXIoITGz7fcvp2mDN4PAgBW9OhIsvHoLASSsWnyya8OHhZlFn P6Or71FhtTwyc5L+MTKy9rhjIJCl5Ei4vEgawlB5HPYhSeBlYAgp0g+t5H1ZMY7d2x8P O4Qm25m1RjG0XycJy0FRnuKAEY+hHyNzsfr26dr/FSxUkE93xnkg0DVGMA3zWtGIHkGV iuuGtBj7uXgPyz0c2W1Jzck/XG9SXxp6YXFIaB41VE6Q8v3xjUCSLfeOwUxsHjl7fM8J ddDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Zk6vu6DD; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=EtTVcikI; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id o9-20020a81de49000000b005a204618ad5si11995754ywl.504.2023.10.25.07.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 07:22:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Zk6vu6DD; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=EtTVcikI; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 420CD807FD59; Wed, 25 Oct 2023 07:22:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234673AbjJYOWA (ORCPT + 99 others); Wed, 25 Oct 2023 10:22:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232846AbjJYOV7 (ORCPT ); Wed, 25 Oct 2023 10:21:59 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3339E99; Wed, 25 Oct 2023 07:21:57 -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 7A60421BB5; Wed, 25 Oct 2023 14:21:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1698243715; 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=6m+wqEMlZRmmaiTawtcjDnjRXGd+ey2+AQbrwr0QEjw=; b=Zk6vu6DDY+yiUE2kKCcR5WHyZ6o2I/EGaNp5h+wXK9fjG5RnNRwIHmRzXe5Q/ffYBo/mTk qguxulYcwWRaKL2yg1UNfhgpqClYn80FvCkAWvzt/QVDlP0UiezNfZImCTr8dkhnGf4rgq t+gSva6X2gDmKBdWUBiDPxvKKxMy1AU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1698243715; 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=6m+wqEMlZRmmaiTawtcjDnjRXGd+ey2+AQbrwr0QEjw=; b=EtTVcikI8IWcHOjnCmdbzjetspIvRIPNXk5rUVrXAMuQy9oZfHZ56OcVWs8k9eeFrL/MmK sQt4Wg6fg02XCsBg== 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 697DB138E9; Wed, 25 Oct 2023 14:21:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id q0EqGYMkOWXhGgAAMHmgww (envelope-from ); Wed, 25 Oct 2023 14:21:55 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id F29D1A0679; Wed, 25 Oct 2023 16:21:54 +0200 (CEST) Date: Wed, 25 Oct 2023 16:21:54 +0200 From: Jan Kara To: Amir Goldstein Cc: Miklos Szeredi , Trond Myklebust , Anna Schumaker , Benjamin Coddington , Jeff Layton , Chuck Lever , Christian Brauner , Jan Kara , linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH] fuse: derive f_fsid from s_dev and connection start time Message-ID: <20231025142154.witld2g5iici24fr@quack3> References: <20231025114228.23167-1-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231025114228.23167-1-amir73il@gmail.com> Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -6.58 X-Spamd-Result: default: False [-6.58 / 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_TWELVE(0.00)[12]; 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(-2.98)[99.92%] 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 25 Oct 2023 07:22:02 -0700 (PDT) On Wed 25-10-23 14:42:28, Amir Goldstein wrote: > Use s_dev number and connection start time to report f_fsid in statfs(2). > > The s_dev number could be easily recycled, so we use lower 32bits of the > connection start time to try to avoid the recycling of f_fsid. > The anon bdev number is only 20 bits (major is 0), so we could use more > bits from connection start time, but avoiding f_fsid recycling is not > critical, so 32bit is enough. > > If the server does not support NFS export, fuse client still advertizes > ->s_export_op, but those are non compliant operations that often cannot > decode file handles, or worse, decode file hanldes to wrong objects. > > In this case, leave f_fsid zero to signal fanotify and aware users to > avoid exporting this incompliant fuse filesystem to NFS. > > This allows fuse client to be monitored by fanotify filesystem watch > for local client file access if server supports NFS export. > > For example, with inotify-tools 4.23.8.0, the following command can be > used to watch local client access over entire nfs filesystem: > > fsnotifywatch --filesystem /mnt/fuse > > Note that fanotify filesystem watch does not report remote changes on > server. It provides the same notifications as inotify, but it watches > over the entire filesystem and reports file handle of objects and fsid > with events. > > Signed-off-by: Amir Goldstein > --- > > Miklos, > > I'd like to explain why I chose to tie setting fuse f_fsid with fuse > server NFS export capability. > > Since v6.6-rc7, fanotify permits sb/mount watch only for filesystems > that know how to decode ALL file handles (not only how to encode). > fanotify checks for the ->fh_to_dentry() method, which fuse always > implements regardless of server NFS export support. > > At first I considered assigning s_export_op depending on server NFS > export support, but that would break the exising fuse best-effort decode > behavior, whatever it is worth. > > Currently, fanotify sb watch does not support fuse because of zero f_fsid, > so I decided to keep it this way for the incomplete NFS export case. OK, so this will keep fanotify not able to support inotify functionality in this corner case. I'm fine with that but I'm making sure I understand the implications. Honza -- Jan Kara SUSE Labs, CR