NFS: allow close-to-open cache semantics to apply to root of NFS filesystem
commitf5a73672d1811f2fb1dcb62ca90ceb12b2050ae7
authorNeil Brown <neilb@suse.de>
Tue, 10 Aug 2010 14:20:05 +0000 (10 10:20 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 10 Aug 2010 14:20:05 +0000 (10 10:20 -0400)
treef9d8798abbcbb6df399dea3d718ded7b2b2b5270
parent669502ff31d7dba1849aec7ee2450a3c61f57d39
NFS: allow close-to-open cache semantics to apply to root of NFS filesystem

To obey NFS cache semantics, the client must verify the cached
attributes when a file is opened.  In most cases this is done by a call to
d_validate as one of the last steps in path_walk.

However for the root of a filesystem, d_validate is only ever called
on the mounted-on filesystem (except when the path ends '.' or '..').
So NFS has no chance to validate the attributes.

So, in nfs_opendir, we revalidate the attributes if the opened
directory is the mountpoint.  This may cause double-validation for "."
and ".." lookups, but that is better than missing regular /path/name
lookups completely.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/dir.c