Subject: [nfsv4] changing fileid of a file during a mount

From: Olga Kornievskaia <[email-masked]>
Date: Thu, 8 Mar 2018 17:17:03 -0500

Hi folks,

Is it allowed that the server changes a fileid of a file on a mounted
file system?

Client opens a file a gets a filehandle A as well as attributes of fileid=1000.
Server changes's this file's fileid=2000.
client request attributes for the filehandle A and gets a fileid=2000.

What is suppose to happen? Should the client simply update its
attributes? Linux client at some point used to fail in this case with
ESTALE. Currently linux client silently ignores the changes in the
fileid done by the server.

In RFC 7530 I see wording that uses "fileid+fsid" to determine if two
file handles are referring to the same file or not. But it doesn't say
anything about if the "fileid" is like a filehandle and suppose to
remain unchanged for the lifetime of the file object.

In RFC 5661 I read about transitions and how in transparent
transitions, the file handles are persistent and fileid/fsid(s) don't
change across transitions. But also in section "11.7.4.  Fileids and
File System Transitions" that talks about transition and how fileids
are (or could be) changing specially if transition is between
different vendors and can't preserve fileid sameness.

But all of this makes me think that on a "non-transition" case a
server shouldn't be changing a fileid. But I can't find anything in
the spec to support this.

Any clarification on this would be highly appreciated.

Thank you.

---

From: Thomas Haynes <[email-masked]>
Date: Thu, 8 Mar 2018 22:27:53 +0000

> On Mar 8, 2018, at 2:17 PM, Olga Kornievskaia <[email-masked]> wrote:
> 
> Hi folks,
> 
> attributes?

No - the fileid uniquely determines the file within the filesystem.

> Linux client at some point used to fail in this case with

Bisect the change and see what the rational was for it?

> remain unchanged for the lifetime of the file object.

If it changes, then it is no longer the same object that the
file handle referred to.

> _______________________________________________
> nfsv4 mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/nfsv4
>

---

From: Olga Kornievskaia <[email-masked]>
Date: Thu, 8 Mar 2018 17:38:52 -0500

> Bisect the change and see what the rational was for it?

Anna changed it to fix a circular directory warning for "junctioned"
mount points. Perhaps the fix wasn't necessary to ignore the changes
in fileid. I think it was an attempt to also check that
mounted_on_fileid didn't change. But unintentionally, if the
mounted_on_fileid() didn't change that's what "validates" fileid even
if fileid did change.

> If it changes, then it is no longer the same object that the

I read this that you think that according to the spec changing fileid
isn't allowed.

>> Any clarification on this would be highly appreciated.

Thank you for the comments!

---

From: [email-masked] (J. Bruce Fields)
Date: Fri, 9 Mar 2018 10:55:36 -0500

> Is it allowed that the server changes a fileid of a file on a mounted

I think the relevant spec language is:

	https://tools.ietf.org/html/rfc7530#section-10.3.4

	If GETATTR directed to the two filehandles returns different
	values for the fileid attribute, then they are distinct objects.

--b.