From nobody@FreeBSD.org  Thu Mar 10 16:29:57 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C0A5816A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Mar 2005 16:29:57 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A2C0443D41
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Mar 2005 16:29:57 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j2AGTrlI020390
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Mar 2005 16:29:53 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j2AGTrFo020389;
	Thu, 10 Mar 2005 16:29:53 GMT
	(envelope-from nobody)
Message-Id: <200503101629.j2AGTrFo020389@www.freebsd.org>
Date: Thu, 10 Mar 2005 16:29:53 GMT
From: Cyril Vechera <cv-c@fluid.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: nfs client open resets attrstamp ever if fs is mounted readonly
X-Send-Pr-Version: www-2.3

>Number:         78673
>Category:       kern
>Synopsis:       [nfs] [patch] nfs client open resets attrstamp ever if fs is mounted readonly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 10 16:30:08 GMT 2005
>Closed-Date:    
>Last-Modified:  Mon Mar 12 15:23:45 GMT 2007
>Originator:     Cyril Vechera
>Release:        5-STABLE
>Organization:
Net Ltd.
>Environment:
FreeBSD cv.ws.local 5.3-RELEASE-p5 FreeBSD 5.3-RELEASE-p5 #1: Thu Mar 10 13:32:50 UTC 2005     root@compiler.incru.net:/usr/src/sys/i386/compile/OFFICIER  i386
>Description:
NFS client resets the timestamp of a cached attributes on each open call.
When the file system is mounted read only it causes unnecessary request
to the NFS server to get fresh access attributes.

>How-To-Repeat:
      
>Fix:
patch attached:
*** /usr/src/sys/nfsclient/nfs_vnops.c.orig    Thu Mar 10 22:23:03 2005
--- /usr/src/sys/nfsclient/nfs_vnops.c Thu Mar 10 00:33:51 2005
***************
*** 463,469 ****
                        np->n_mtime = vattr.va_mtime.tv_sec;
                }
        }
!       np->n_attrstamp = 0; /* For Open/Close consistency */
        return (0);
  }

--- 463,470 ----
                        np->n_mtime = vattr.va_mtime.tv_sec;
                }
        }
!       if (!(vp->v_mount->mnt_flag & MNT_RDONLY))
!               np->n_attrstamp = 0; /* For Open/Close consistency */
        return (0);
  }


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cel 
Responsible-Changed-By: cel 
Responsible-Changed-When: Wed May 24 19:37:56 UTC 2006 
Responsible-Changed-Why:  
Interestingly, Solaris does this too, though I would argue with the 
blanket claim that close-to-open cache consistency is unnecessary on 
read-only mounts.  Will look into it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78673 
Responsible-Changed-From-To: cel->freebsd-bugs 
Responsible-Changed-By: cel 
Responsible-Changed-When: Mon Mar 12 15:23:25 UTC 2007 
Responsible-Changed-Why:  
Back to the public pool. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78673 
>Unformatted:
