]> git.baikalelectronics.ru Git - kernel.git/commit
NFSD: Decode NFSv4 birth time attribute
authorChuck Lever <chuck.lever@oracle.com>
Sun, 10 Jul 2022 18:46:04 +0000 (14:46 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 11 Jul 2022 17:52:22 +0000 (13:52 -0400)
commit68a140085743ad373de883016f38a34604c1965d
tree4d7fa7e3438ce81f34c9410f67e2b58688908747
parentfba88aaf8c894094400945ac01cc97cc157e9f02
NFSD: Decode NFSv4 birth time attribute

NFSD has advertised support for the NFSv4 time_create attribute
since commit 2e7421223ef6 ("nfsd: Add support for the birth time
attribute").

Igor Mammedov reports that Mac OS clients attempt to set the NFSv4
birth time attribute via OPEN(CREATE) and SETATTR if the server
indicates that it supports it, but since the above commit was
merged, those attempts now fail.

Table 5 in RFC 8881 lists the time_create attribute as one that can
be both set and retrieved, but the above commit did not add server
support for clients to provide a time_create attribute. IMO that's
a bug in our implementation of the NFSv4 protocol, which this commit
addresses.

Whether NFSD silently ignores the new birth time or actually sets it
is another matter. I haven't found another filesystem service in the
Linux kernel that enables users or clients to modify a file's birth
time attribute.

This commit reflects my (perhaps incorrect) understanding of whether
Linux users can set a file's birth time. NFSD will now recognize a
time_create attribute but it ignores its value. It clears the
time_create bit in the returned attribute bitmask to indicate that
the value was not used.

Reported-by: Igor Mammedov <imammedo@redhat.com>
Fixes: 2e7421223ef6 ("nfsd: Add support for the birth time attribute")
Tested-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4xdr.c
fs/nfsd/nfsd.h