| Summary: | [nfs] NFS client modification time resolution is not high enough, which may cause client side cache inconsistent | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Wencheng Chai <wchai> | ||||||
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||||
| Status: | Closed FIXED | ||||||||
| Severity: | Affects Only Me | ||||||||
| Priority: | Normal | ||||||||
| Version: | Unspecified | ||||||||
| Hardware: | Any | ||||||||
| OS: | Any | ||||||||
| Attachments: |
|
||||||||
Responsible Changed From-To: freebsd-bugs->peter Looks like a job for EvilPete State Changed From-To: open->feedback Is this still a problem? I haven't seen this. Responsible Changed From-To: peter->freebsd-bugs Is this still a problem? I haven't seen this. State Changed From-To: feedback->closed Feedback timeout (> 3 months). |
The NFS client side stores the value of va_mtime only in total number of seconds(va_mtime.tv_sec), even the server sends the mtime in term of seconds and nanoseconds. Fix: ====================================================================== ====================================================================== ======================================================================--B7L25IHA1UoJhWtDrMwCJianooNVdt4gwwpHW9kZvm9uKpuo Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" *** /usr/src/sys/nfs/nfs_bio.c Tue Aug 21 12:39:09 2001 --- nfs_bio.c Wed Sep 12 03:45:03 2001 *************** *** 394,410 **** if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } else { error = VOP_GETATTR(vp, &vattr, cred, p); if (error) return (error); ! if (np->n_mtime != vattr.va_mtime.tv_sec) { if (vp->v_type == VDIR) nfs_invaldir(vp); error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } } } --- 394,415 ---- if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; + np->n_vattr.va_mtime.tv_sec = vattr.va_mtime.tv_sec; + np->n_vattr.va_mtime.tv_nsec = vattr.va_mtime.tv_nsec; } else { error = VOP_GETATTR(vp, &vattr, cred, p); if (error) return (error); ! if ((np->n_vattr.va_mtime.tv_sec != vattr.va_mtime.tv_se c)||((np->n_vattr.va_mtime.tv_sec == vattr.va_mtime.tv_sec)&&(np->n_vattr.va_mti me.tv_nsec != vattr.va_mtime.tv_nsec))) { if (vp->v_type == VDIR) nfs_invaldir(vp); error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; + np->n_vattr.va_mtime.tv_sec = vattr.va_mtime.tv_ sec; + np->n_vattr.va_mtime.tv_nsec = vattr.va_mtime.tv _nsec; + } } } How-To-Repeat: Two NFS clients mounted from the same exported FS, Type "touch file1" and "touch file2" from different clients simultaneously, then type "ls -l" from the first client, the output of "ls" only shows file1.