Switch vfs.nfsd.issue_delegations to TUNABLE ?

Rick Macklem rmacklem at uoguelph.ca
Wed Nov 29 17:28:06 UTC 2017

Emmanuel Vadot wrote:
[stuff snipped]
> I haven't test by I can say that it will work, I actually wondered at
>first doing that. The problem with this patch is what I tried to
>describe in my first and following mails, since you can turn on and off
>delegation you can still have delegation (so nfsrv_delegatecnt > 0)
>even if the sysctl is == 0. That's why I went to the tunable way, seems
>cleaner to me as disabling delegation doesn't really disable them for
>current client.
Yes, if you have delegations enabled and then disable them, there will
be delegations issued for a "while".
During that time, the code in nfsrv_checkgetattr() does need to check for
Since no new delegations will be issued, the outstanding ones will go
away when the client chooses to return them. (You can force this on the
client by doing a dismount/mount, at least for the FreeBSD client.)
Alternately, rebooting the server forces the clients to "recover" delegations
and, if they are disabled, that fails. (Actually the recover succeeds, but with
a flag set that tells the client it must return them asap.)

All the tunable does is make it impossible to disable them without
rebooting, but otherwise the effect is the same.

I have a patch that keeps a separate counter for write delegations
(which are the ones you care about) using atomics to maintain the
value. (That will be similar but somewhat better than what this patch does.)

[lots more snipped]

More information about the freebsd-fs mailing list