Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5618046pxv; Wed, 28 Jul 2021 15:26:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFudBzc3LOD1Hu7dENQK2K76TkD6UfgjDcTvqb4G+dOPac5x6S/zrwAYiZHsI7jBr+Xde/ X-Received: by 2002:a05:6638:33a6:: with SMTP id h38mr1716822jav.130.1627511192350; Wed, 28 Jul 2021 15:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627511192; cv=none; d=google.com; s=arc-20160816; b=J1aBNb9usZf7UFromCp2/+lmBmV/1FEXvXhc3yFawwJL9hA1c1/vkl37MWN9ImnZJe bYINPkz/fyCy3JMBXpdPN5BIbJ1uSe1rM/DbRoohvKufCzRxYdt6CMpeUk6Hia/1xbFi ejNUG6mO2UGFRpzQWhhUxzg0kAPBarLdBE9X7eCubHjA6W/qJ8YKdOPQylU/aVHYOpHO fxC+fJ4Xc06FZsbpeu3COjlzpvU5yuUjiG52y9APJ6s4O1KarIto25nah9bYZoROQQLK Oo+WAknF7R7YYgEkL1Ll6ARKCFx9EushFM1+tSPl/5uC+YTkuZOKOyLC1MjlpOnnlH1u tFNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=hjqme1zUDcnCcoQ3Tk+VHxnefaATV89KJZnBvhXQjFA=; b=LLq3Dl+VD5T1y2sJH7sgSxPT14L9S0qiS5Zp1CTn0QHhX9vMlsMfCCo7OyWkhYdv6/ IhMnSIjAjAtoB/ubN4j8cetqAnyg4kz2L22WVGx2xx3hB3VPANP2L6YZpVwTzLZpDNLs 3l9nPZDb4fDZr3UeApQCJAwhs5LgoTtBpNPXWRPZCy2IPOsnmQnF6/k8qlDH5bq/5bTG dNjU54tXEIl9BB0JCz/w9lNtfpkZeWKNboylKzJXsTFXrk8GaTmY7ETXyLRFFZzm+BvI Zc90o/nR9DtegvCFBOkEotusnpQAlINvsBuFY7VJTwQP1bSOE5aHfYmHINBRUs5DkQCC e33w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ilInrbZF; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si1202193ilk.49.2021.07.28.15.25.45; Wed, 28 Jul 2021 15:26:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ilInrbZF; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232022AbhG1WZj (ORCPT + 99 others); Wed, 28 Jul 2021 18:25:39 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:54054 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231989AbhG1WZi (ORCPT ); Wed, 28 Jul 2021 18:25:38 -0400 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-out2.suse.de (Postfix) with ESMTPS id C2A511FFFC; Wed, 28 Jul 2021 22:25:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627511135; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hjqme1zUDcnCcoQ3Tk+VHxnefaATV89KJZnBvhXQjFA=; b=ilInrbZFKX8z9FuzlIy3upOXktBpM2kuOdFc746OIss7c3RfZzh+438j+1r0gOkFUJ7bkn U1lQx/2lxi8zlln0vXKn91Z64LgK9rcMZFLAej96S8LTfLtdG58Yy+qNqNTDb7NQNGqlQ1 9osZkZr3/h8YYrHr4P1+nJYrQLHG01I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627511135; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hjqme1zUDcnCcoQ3Tk+VHxnefaATV89KJZnBvhXQjFA=; b=DC6yRi2TJLwl24uaWgAmLztV9spiv/95pJXC4jAxYXp91tLSjJk9TmT9Wok5B/wQVRrGDU nnSoBaZSdPm5pCAQ== 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 DDD7913BC4; Wed, 28 Jul 2021 22:25:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id yB6XJlzZAWEzXQAAMHmgww (envelope-from ); Wed, 28 Jul 2021 22:25:32 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "J. Bruce Fields" Cc: "Christoph Hellwig" , "Josef Bacik" , "Chuck Lever" , "Chris Mason" , "David Sterba" , "Alexander Viro" , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [PATCH 07/11] exportfs: Allow filehandle lookup to cross internal mount points. In-reply-to: <20210728191711.GC3152@fieldses.org> References: <162742539595.32498.13687924366155737575.stgit@noble.brown>, <162742546554.32498.9309110546560807513.stgit@noble.brown>, <20210728191711.GC3152@fieldses.org> Date: Thu, 29 Jul 2021 08:25:29 +1000 Message-id: <162751112971.21659.13568311032380832336@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, 29 Jul 2021, J. Bruce Fields wrote: > On Wed, Jul 28, 2021 at 08:37:45AM +1000, NeilBrown wrote: > > @@ -232,6 +239,68 @@ reconnect_path(struct vfsmount *mnt, struct dentry *= target_dir, char *nbuf) > > } > > dput(dentry); > > clear_disconnected(target_dir); >=20 > Minor nit--I'd prefer the following in a separate function. Fair. Are you thinking "a separate function that is called here" or "a separate function that needs to be called by whoever called exportfs_decode_fh_raw()" if they happen to want the vfsmnt to be updated? NeilBrown >=20 > --b. >=20 > > + > > + /* Need to find appropriate vfsmount, which might not exist yet. > > + * We may need to trigger automount points. > > + */ > > + path.mnt =3D mnt; > > + path.dentry =3D target_dir; > > + vfs_getattr_nosec(&path, &stat, 0, AT_STATX_DONT_SYNC); > > + target_dev =3D stat.dev; > > + > > + path.dentry =3D mnt->mnt_root; > > + vfs_getattr_nosec(&path, &stat, 0, AT_STATX_DONT_SYNC); > > + > > + while (stat.dev !=3D target_dev) { > > + /* walk up the dcache tree from target_dir, recording the > > + * location of the most recent change in dev number, > > + * until we find a mountpoint. > > + * If there was no change in show_dev result before the > > + * mountpount, the vfsmount at the mountpoint is what we want. > > + * If there was, we need to trigger an automount where the > > + * show_dev() result changed. > > + */