2009-08-25 19:55:32

by Chuck Lever III

[permalink] [raw]
Subject: Re: NFS v3 cached directory content out of sync

On Aug 25, 2009, at 3:45 PM, Stefan Egli wrote:
> Thanks Mates! I've seen those manuals but the bug I'm chasing doesn't
> seem to be documented ;)
>
> Just now that I got your attention :) one final clarification
> question:
> * the attribute cache (==metadata cache) is part of the nfs client
> code
> * the date (=file content) cache would be the normal linux caching

A file's mtime/ctime/atime is stored in the generic in-core inode.
The inode cache is "normal linux caching". File content is cached in
the kernel's regular page cache, also considered "normal linux
caching". The difference for NFS files is how this information is
updated and flushed back to persistent storage.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





2009-08-26 16:12:46

by Stefan Egli

[permalink] [raw]
Subject: Re: NFS v3 cached directory content out of sync

FYI: For the reference a quick summary of this issue:

Linux Kernels older than 2.6.30 (or at least in 2.6.26 which we're
using) have this bug which can be reproduced as follows:

* have two hosts: host A and host B - both having the same NFS
directory mounted and being in the same subdirectory on that NFS

* host A: mkdir testdir; touch -m --date "2009-08-25 11:35" testdir
* host B: ls testdir
* host A: touch testdir/aNewFile; touch -m --date "2009-08-25 11:35" testdir
* host B: ls testdir
* shows an empty directory - even though 'aNewFile' just got
created. This remains so for hours.

The commit-set ID which is probably related (as of now I couldn't test
the above on 2.6.30):

37d9d76d8b3a2ac5817e1fa3263cfe0fdb439e51

Cheers,
Stefan