remarkable-linux/fs/nfs
NeilBrown 4fa2c54b51 NFS: nfs4_do_open should add negative results to the dcache.
If you have an NFSv4 mounted directory which does not container 'foo'
and:

  ls -l foo
  ssh $server touch foo
  cat foo

then the 'cat' will fail (usually, depending a bit on the various
cache ages).  This is correct as negative looks are cached by default.
However with the same initial conditions:

  cat foo
  ssh $server touch foo
  cat foo

will usually succeed.  This is because an "open" does not add a
negative dentry to the dcache, while a "lookup" does.

This can have negative performance effects.  When "gcc" searches for
an include file, it will try to "open" the file in every director in
the search path.  Without caching of negative "open" results, this
generates much more traffic to the server than it should (or than
NFSv3 does).

The root of the problem is that _nfs4_open_and_get_state() will call
d_add_unique() on a positive result, but not on a negative result.
Compare with nfs_lookup() which calls d_materialise_unique on both
a positive result and on ENOENT.

This patch adds a call d_add() in the ENOENT case for
_nfs4_open_and_get_state() and also calls nfs_set_verifier().

With it, many fewer "open" requests for known-non-existent files are
sent to the server.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2014-08-03 17:05:22 -04:00
..
blocklayout FS/NFS: replace count*size kzalloc by kcalloc 2014-06-25 19:02:14 -04:00
filelayout pnfs/filelayout: retry ds commit if nfs_commitdata_alloc fails 2014-07-12 18:22:45 -04:00
objlayout nfs: remove unused writeverf code 2014-06-24 18:47:00 -04:00
cache_lib.c
cache_lib.h
callback.c nfs4: copy acceptor name from context to nfs_client 2014-07-12 18:41:25 -04:00
callback.h
callback_proc.c NFSv4.1: Minor optimisation in get_layout_by_fh_locked() 2014-02-19 21:21:06 -05:00
callback_xdr.c
client.c nfs4: copy acceptor name from context to nfs_client 2014-07-12 18:41:25 -04:00
delegation.c nfs4: add nfs4_check_delegation 2014-07-12 18:22:58 -04:00
delegation.h nfs4: add nfs4_check_delegation 2014-07-12 18:22:58 -04:00
dir.c NFS: Enforce an upper limit on the number of cached access call 2014-08-03 17:03:22 -04:00
direct.c Merge branch 'bugfixes' into linux-next 2014-07-13 15:22:02 -04:00
dns_resolve.c
dns_resolve.h
file.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2014-06-12 10:30:18 -07:00
fscache-index.c
fscache.c
fscache.h
getroot.c NFS: Fix memroy leak for double mounts 2014-04-15 10:29:25 -04:00
idmap.c
inode.c NFS: Don't mark the data cache as invalid if it has been flushed 2014-06-24 18:46:57 -04:00
internal.h Merge branch 'bugfixes' into linux-next 2014-07-13 15:22:02 -04:00
iostat.h
Kconfig
Makefile Push the file layout driver into a subdirectory 2014-05-29 20:21:56 -04:00
mount_clnt.c
namespace.c
netns.h
nfs.h
nfs2super.c
nfs2xdr.c NFS: Create a common results structure for reads and writes 2014-05-28 18:12:43 -04:00
nfs3acl.c nfs3_list_one_acl(): check get_acl() result with IS_ERR_OR_NULL 2014-08-03 17:05:22 -04:00
nfs3client.c
nfs3proc.c Merge branch 'bugfixes' into linux-next 2014-07-13 15:22:02 -04:00
nfs3super.c
nfs3xdr.c NFS: Create a common results structure for reads and writes 2014-05-28 18:12:43 -04:00
nfs4_fs.h nfs4: turn free_lock_state into a void return operation 2014-07-12 18:36:37 -04:00
nfs4client.c nfsv4: set hostname when creating nfsv4 ds connection 2014-07-08 14:30:03 -04:00
nfs4file.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2014-06-12 10:30:18 -07:00
nfs4getroot.c
nfs4namespace.c NFSv4: test SECINFO RPC_AUTH_GSS pseudoflavors for support 2014-06-24 18:46:58 -04:00
nfs4proc.c NFS: nfs4_do_open should add negative results to the dcache. 2014-08-03 17:05:22 -04:00
nfs4renewd.c
nfs4session.c NFSv4.1: nfs4_destroy_session must call rpc_destroy_waitqueue 2014-02-01 15:13:39 -05:00
nfs4session.h NFSv4.1: nfs4_destroy_session must call rpc_destroy_waitqueue 2014-02-01 15:13:39 -05:00
nfs4state.c nfs4: queue free_lock_state job submission to nfsiod 2014-07-12 18:36:35 -04:00
nfs4super.c mm + fs: store shadow entries in page cache 2014-04-03 16:21:01 -07:00
nfs4sysctl.c nfs: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:16 -07:00
nfs4trace.c
nfs4trace.h nfs: merge nfs_pgio_data into _header 2014-06-24 18:47:00 -04:00
nfs4xdr.c NFSv4: Drop cast 2014-07-12 18:43:47 -04:00
nfsroot.c
nfstrace.c
nfstrace.h NFS: fix the handling of NFS_INO_INVALID_DATA flag in nfs_revalidate_mapping 2014-01-27 15:35:56 -05:00
pagelist.c Merge branch 'bugfixes' into linux-next 2014-07-13 15:22:02 -04:00
pnfs.c pnfs: clean up *_resend_to_mds 2014-06-24 18:47:01 -04:00
pnfs.h pnfs: clean up *_resend_to_mds 2014-06-24 18:47:01 -04:00
pnfs_dev.c
proc.c nfs: merge nfs_pgio_data into _header 2014-06-24 18:47:00 -04:00
read.c nfs: get rid of duplicate dprintk 2014-06-25 19:01:27 -04:00
super.c NFS: use ARRAY_SIZE instead of sizeof/sizeof[0] 2014-07-12 18:43:58 -04:00
symlink.c
sysctl.c nfs: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:16 -07:00
unlink.c nfs: emit a fsnotify_nameremove call in sillyrename codepath 2014-03-17 15:14:17 -04:00
write.c Merge branch 'bugfixes' into linux-next 2014-07-13 15:22:02 -04:00