]> git.ipfire.org Git - people/arne_f/kernel.git/commit
NFS: nfs_lookup - don't hash dentry when optimising away the lookup
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 18 Dec 2006 19:55:04 +0000 (20:55 +0100)
committerAdrian Bunk <bunk@stusta.de>
Mon, 18 Dec 2006 19:55:04 +0000 (20:55 +0100)
commit1488da2060a943584163df47a51d25c708e88b1a
treed91b1f18be8c13137cbbd105d7313152bbb7a1e7
parente634599b5e6b766634a77b2e05a492c08b32a3a5
NFS: nfs_lookup - don't hash dentry when optimising away the lookup

If the open intents tell us that a given lookup is going to result in a,
exclusive create, we currently optimize away the lookup call itself. The
reason is that the lookup would not be atomic with the create RPC call, so
why do it in the first place?

A problem occurs, however, if the VFS aborts the exclusive create operation
after the lookup, but before the call to create the file/directory: in this
case we will end up with a hashed negative dentry in the dcache that has
never been looked up.
Fix this by only actually hashing the dentry once the create operation has
been successfully completed.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
fs/nfs/dir.c