From owner-freebsd-fs@FreeBSD.ORG Mon Sep 19 02:25:53 2005 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D211516A420 for ; Mon, 19 Sep 2005 02:25:53 +0000 (GMT) (envelope-from ezk@fsl.cs.sunysb.edu) Received: from filer.fsl.cs.sunysb.edu (filer.fsl.cs.sunysb.edu [130.245.126.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A76443D4C for ; Mon, 19 Sep 2005 02:25:53 +0000 (GMT) (envelope-from ezk@fsl.cs.sunysb.edu) Received: from agora.fsl.cs.sunysb.edu (agora.fsl.cs.sunysb.edu [130.245.126.12]) by filer.fsl.cs.sunysb.edu (8.12.8/8.12.8) with ESMTP id j8J2Pj9P014911; Sun, 18 Sep 2005 22:25:45 -0400 Received: from agora.fsl.cs.sunysb.edu (localhost.localdomain [127.0.0.1]) by agora.fsl.cs.sunysb.edu (8.13.1/8.13.1) with ESMTP id j8J2Pi7m016628; Sun, 18 Sep 2005 22:25:44 -0400 Received: (from ezk@localhost) by agora.fsl.cs.sunysb.edu (8.13.1/8.12.8/Submit) id j8J2PclG016625; Sun, 18 Sep 2005 22:25:38 -0400 Date: Sun, 18 Sep 2005 22:25:38 -0400 Message-Id: <200509190225.j8J2PclG016625@agora.fsl.cs.sunysb.edu> From: Erez Zadok To: Scott Long , Kris Kennaway , Erez Zadok , freebsd-fs@freebsd.org, christos@zoulas.com In-reply-to: Your message of "Sun, 18 Sep 2005 18:12:36 MDT." <432E0274.4010704@samsco.org> X-MailKey: Erez_Zadok Cc: Subject: Re: turning off the NFS attribute cache X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2005 02:25:54 -0000 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.