I'll admit I lost the indentations indicating who wrote what, but my comment is fairly generic w.r.t. this. >> From: "Malahal Naineni" <malahal@xxxxxxxxx> >> To: "NeilBrown" <neilb@xxxxxxxx> >> Cc: "Marc Eshel" <eshel@xxxxxxxxxx>, "Benjamin Coddington" <bcodding@xxxxxxxxxx>, "linux-nfs" >> <linux-nfs@xxxxxxxxxxxxxxx>, linux-nfs-owner@xxxxxxxxxxxxxxx, "Matt Benjamin" <mbenjami@xxxxxxxxxx>, "trondmy" >> <trondmy@xxxxxxxxxxxxxxx> >> Sent: Monday, November 5, 2018 8:40:16 AM >> Subject: Re: "(deleted)" directories > >>>> My reading of section 10.3.4 of RFC7530 suggests that the client should >> generally compare fsid and fileid to see if two different filehandles refer to >> the same object or not. >> >> Section 10.3.4 is for files only correct? The issue here is for >> directories. Also, Trond clearly pointed that Linux breaks section >> 10.3.4 from his email stating "We treat always different filehandles >> as if they refer to different >> files. It has long been the case that snapshots from several vendors >> are encoded to look like the same file (same fileid + same fsid) and >> differing only by filehandle. If we were to try to consolidate those >> inodes we would end up corrupting application data." >> >> We don't respect either NFSv3 or NFSv4 RFCs in this regard! Part of the question for NFSv4 is whether or not the server returns "unique_handles == true"? For example, if Netapp filers return "unique_handles" as true, then they are fine for NFSv4 using the same (fsid, fileno) for two distinct files. (Second bullet point in RFC 7530 Sec. 10.3.4.) Is there an example (like Netapp) where the only difference is the file handle and the server returns "unique_handles == false"? One approach for a client might be the following: - if NFSv3 - set unique_handles true - if file handles same - same file object else if unique_handles == true - different file object else - if fsid or fileno not same - different file object else - same file object Btw, Sec. 10.3.4 of RFC7530 discusses file objects, so I'd think it is meant to apply to directories as well as regular files. (It does talk about "file data", but I think that can refer to directory contents?) I'll admit I can't remember what the behaviour of the FreeBSD NFS client is for non-unique file handles, but I might take a look and try to make it use the above algorithm. rick