turning off the NFS attribute cache

Erez Zadok ezk at cs.sunysb.edu
Sun Sep 18 19:25:54 PDT 2005


Good news!

After browsing the 6.0 kernel sources, I found out that freebsd DOES indeed
have a way of turning off the attribute cache.  It's not enough to just set
nfs_args->acregmin and friends, but you also need to

	nfs_args->flags |= NFSMNT_ACREGMIN

Otherwise, the kernel ignores what you set in the ->acregmin field.  So, to
completely turn off the attrcache on freebsd, you have to set four fields in
struct nfs_args to 0, and turn four flags on in ->flags.

It's cumbersome, but it works.  You may still want to consider offering a
"noac" flag for convenience, which'd set all eight values as needed (as some
OSs do).  At the very least, please document specifically in the mount_nfs
man page how one turns off the attribute cache completely.

Anyway, I was able to verify this in 5.4 and 6.0 (SNAP001).  And it looks
like the NFSMNT_ACREGMIN type of flags have existed as far back as 4.x, so I
suspect that as long as the implementation was correct, even old versions of
BSD should work well now with Amd.

I'll release a quick new version of am-utils (6.1.2.1) with this fix,
specifically because I have a few freebsd users who complained about this
bug.

I would like to ask whomever is responsible for maintaining am-utils for
FreeBSD to consider importing 6.1.2.1 into your ports tree.  Currently
you're stuck at an ancient 6.0.10.  6.1.x fixes numerous bugs other than
this latest one, plus it offers a host of new performance and security
features.

Thanks,
Erez.


More information about the freebsd-fs mailing list