[Bug 298350] Need NFSv4.1 WANT_DELEGATION op support

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 14 Oct 2026 19:54:17 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298350

--- Comment #5 from Rick Macklem <rmacklem@FreeBSD.org> ---
(In reply to Lionel Cons from comment #4)
Here's the problem..
Process A on client Opens a file for writing. Client gets a write
delegation for the file and writes data to the file cached in the
client.

Process B on client does a SETATTR of mode/acl/owner/owner_group
such that Process A no longer has write access to the file.

If the server doesn't CB_RECALL the delegation, when the cached
data written by Process A is flushed to the server, the writes
fail.
--> As such, the server does the CB_RECALL so that the client
    flushes written data to the server before the server does
    the SETATTR that disallows write access to Process A.

Note that NFS servers have checked permissions for reads/writes
forever. That's one of the reasons that NFS is not a POSIX compliant
file system.

If RFC-8881 stated that "if a client holds a valid write delegation
for a file, writing must be allowed regardless of file permissions",
then there wouldn't be a need to do the CB_RECALL, but afaik RFC-8881
does not say that. (Some NFSv4 servers might choose to allow this,
but the FreeBSD server currently does not.)

It would be better if the client specified the desired
mode/acl/owner/owner_group in the attribute arguments to the
OPEN and avoided a subsequent SETATTR.

-- 
You are receiving this mail because:
You are the assignee for the bug.