From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D596A362133 for ; Fri, 12 Jun 2026 18:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781287608; cv=none; b=VUrKhPeli/4gCCY8PoQ/AYPRWzZ3Lv48dUAFXFXHsqV1G7XshbshjjT794KMlrM1VUxsvfx1/bfiYTuoMtSlGEb7xwDhRzw6VhzEpFGBWQIrYuE/6uIHnHnwinMILH2maVVCqQTCv6lKPeuhNlg+fXLEX6R+2Q3jr8WQYOQHtgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781287608; c=relaxed/simple; bh=FQmoC/THZFYDinoISuSgMGxtC4zsYy3pSr7P1Tttr7M=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=azN8pDV7Fy3gPthjUJ15y7IKOozhF7p71BdHAYaYMpl+3l27TFpC2Mk7nvdKH7EbiJYabpBfk1t1xK4nz1IE9DdQOKklxYKAkA8xicRNWaR8N/ehxRRYsG3Zu1IbMEFD46D/DkGRIFTtRBIU6tcGY19pWOfJFPInvKk0vgr/BUw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M70YIS7V; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M70YIS7V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18C471F000E9; Fri, 12 Jun 2026 18:06:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781287607; bh=rmY1XRorY8tm5XzOd9JYKm0uRq7CNXbvzLRe3jdbwDg=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=M70YIS7VJLEA2qltrMAK6gS5r16XEa6J89SNWFScureuKzVBwW+xAFVcufGQsWEoR UH4lUVHP7kuJ/qb+15euCKAWktJYL47xvA0Ec26fDdlUxf+gZwcwP4hKq6iwgVAYDj mbPH25KaOTmgpfJViJF+CrHX2sBnrkdNWgG0SQ/8t6SZ1X6Xn+pBwpicijMnbMpqjt Kh7jIikUkWaRknb/lOqPDVNKv9zgRVJu6L1wQTPAFoefPwUibscNSmHesGdZv9LgHv G/PWDsIzcgORzwvatSnze5Wuc3W4z7fO+TkGVDeysq6/etN6xZKZRqDRy1ACmEWaRf wUrNadjDXwj9A== Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfauth.phl.internal (Postfix) with ESMTP id 4F23CF4007F; Fri, 12 Jun 2026 14:06:46 -0400 (EDT) Received: from phl-imap-15 ([10.202.2.104]) by phl-compute-10.internal (MEProxy); Fri, 12 Jun 2026 14:06:46 -0400 X-ME-Sender: X-ME-Proxy-Cause: dmFkZTGuG3AeyMng7EVTxNkDhwUN31636ADY31p/mQRJyX7o4zQekp8lH6WwjTx6lDnD+Z MTqLXMQnpZPmVLmnk4AdaHwpfT7LtZGmY5W3+f982Fe+z/7EQ8/5yRXiEzf8MCC0e+q1i5 K8+aoFiKyIlnhk6ps34RLwmyopZmJuXaUH3gnyqrrtWnJTSRyyv+yZX35eZoYsFu4b6Q7F 85MEHNo2v/w1VvHKPGIVPH9xgMOAsPi97JL44NTpYsLe0QG6azo/OKZzVfcaGla0kMy/Ia TfpY6z7maAU/nNyC71NfiHdvCkxOB9TK9rMuIMgxDpLg+LzkIh6l8s26eJHt31JfFNTNPZ 1r2IZZRFTH8vKNk7rcDAqDFSyJRRXCNTDr3fvxdm5otCWTavIfuJw6CkbmzwpsvcZWLpfr gE/FD++SPZ9McuWpPyf+bvS83g4C94bxuTdhOu266V+muxKjt63z0XEJnf3hpFyDcJAWhX wK4XYADOJ+Y6DjKh1FKG0IflMAsKjjcBYkaCUAVr8g1NanSLkolwTtIWLhVRST0yq/JxZu gcye2PYG4wBh5XEkY8rkCVjWbJTcnwrM+yeu6/o1L/+ZpldlUfMU1bPFItriWxzfN/YyaK YCje6jUMNwTdg8IIqMl8iLeLaKuJ/+FNsfDsxFRaOJtb+r5mmJ45fG6S2C7g X-ME-Proxy: Feedback-ID: ifa6e4810:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 29E53780070; Fri, 12 Jun 2026 14:06:46 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: AUcBOYW56SA3 Date: Fri, 12 Jun 2026 14:06:24 -0400 From: "Chuck Lever" To: "Jeff Layton" , NeilBrown , "Olga Kornievskaia" , "Dai Ngo" , "Tom Talpey" , "Trond Myklebust" , "Anna Schumaker" , "Jonathan Corbet" , "Shuah Khan" Cc: "Steven Rostedt" , "Alexander Aring" , "Amir Goldstein" , "Jan Kara" , "Alexander Viro" , "Christian Brauner" , "Calum Mackay" , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-nfs@vger.kernel.org Message-Id: In-Reply-To: <20260611-dir-deleg-v6-16-4c45080e5f3f@kernel.org> References: <20260611-dir-deleg-v6-0-4c45080e5f3f@kernel.org> <20260611-dir-deleg-v6-16-4c45080e5f3f@kernel.org> Subject: Re: [PATCH v6 16/20] nfsd: add a fi_connectable flag to struct nfs4_file Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, Jun 11, 2026, at 1:50 PM, Jeff Layton wrote: > When encoding a filehandle for a CB_NOTIFY, there is no svc_export > available, but the server needs to know whether to encode a connectable > filehandle. Add a flag to the nfs4_file that tells whether the > svc_export under which a directory delegation was acquired has subtree > checking enabled, in which case it needs connectable filehandles. > > Signed-off-by: Jeff Layton > --- > fs/nfsd/nfs4state.c | 1 + > fs/nfsd/state.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index 513cbc1a583f..aa99783ce901 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -5231,6 +5231,7 @@ static void nfsd4_file_init(const struct svc_fh > *fh, struct nfs4_file *fp) > memset(fp->fi_access, 0, sizeof(fp->fi_access)); > fp->fi_aliased = false; > fp->fi_inode = d_inode(fh->fh_dentry); > + fp->fi_connectable = !(fh->fh_export->ex_flags & > NFSEXP_NOSUBTREECHECK); > #ifdef CONFIG_NFSD_PNFS > INIT_LIST_HEAD(&fp->fi_lo_states); > atomic_set(&fp->fi_lo_recalls, 0); > diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h > index f8457e0f2b57..d912e3d04dd7 100644 > --- a/fs/nfsd/state.h > +++ b/fs/nfsd/state.h > @@ -761,6 +761,7 @@ struct nfs4_file { > int fi_delegees; > struct knfsd_fh fi_fhandle; > bool fi_had_conflict; > + bool fi_connectable; > #ifdef CONFIG_NFSD_PNFS > struct list_head fi_lo_states; > atomic_t fi_lo_recalls; > When two clients use exports of the same directory root that differ only in subtree_check/no_subtree_check, the root filehandle is the same and nfsd4_file_hash_insert() can reuse the same nfs4_file. This makes fi_connectable depend on whichever export first initialized the shared object, so a later directory delegation acquired under the other export can encode CB_NOTIFY child filehandles with the wrong connectability. Therefore, the delegation's sc_export is the per-export state to derive connectability from, and the export is already available via dp->dl_stid.sc_export. -- Chuck Lever