Page MenuHomeFreeBSD

chflags: Add a new UF_DONTCACHE flag
ClosedPublic

Authored by rmacklem on Sun, Jul 12, 1:13 AM.

Details

Summary

This internet draft (which is close to being an RFC)
specifies a new NFSv4.2 attribute which tells the NFSv4.2
client to not cache file data. (Similar to O_DIRECT, but
triggered by this attribute set on the file on the NFSv4.2
server and not by the application's open(2).)

https://datatracker.ietf.org/doc/draft-ietf-nfsv4-uncacheable-files/

I am thinking that this can be implemented as a
new UF_xxx va_flags bit. I called it UF_DONTCACHE,
but anyone can suggest a better name.

There has only been one response to my email on
freebsd-fs@ and they supported this idea.

Patches for NFS and ZFS will be done separately.

Test Plan

Tried setting and clearing the flag with chflags(1)
and checked it will ls(1) using the "-o" option.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Sun, Jul 12, 10:45 AM
This revision was automatically updated to reflect the committed changes.

This would have been nicer if the flag was named "noucache" with inverse
semantics as with nodump. (so "ucache" to turn it off)
nodontcache is a weird double negation.

Maybe this can still be revised?

In D58181#1334837, @fuz wrote:

This would have been nicer if the flag was named "noucache" with inverse
semantics as with nodump. (so "ucache" to turn it off)
nodontcache is a weird double negation.

Maybe this can still be revised?

Please post a response on freebsd-fs@ to the email I sent..
https://lists.freebsd.org/archives/freebsd-fs/2026-July/005300.html

It specifically asked if a different name was preferred.

We'll see if others agree that your name suggestion is preferred.

rick