kern/78673: nfs client open resets attrstamp ever if fs is mounted readonly

Cyril Vechera cv-c at fluid.ru
Thu Mar 10 16:30:09 GMT 2005


>Number:         78673
>Category:       kern
>Synopsis:       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:
>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 at 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 couses 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:
>Unformatted:


More information about the freebsd-bugs mailing list