[PATCH] NFS: nfs_lookup - don't hash dentry when optimising away the lookup
commit0f899fb74e5637b29b4c8a80ea039af137c12fec
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 5 Sep 2006 16:27:44 +0000 (5 12:27 -0400)
committerChris Wright <chrisw@sous-sol.org>
Sat, 4 Nov 2006 01:33:49 +0000 (3 17:33 -0800)
treec7e05878c4bc43d5d302ba3cf1c9c9e1ad60984f
parentd940c78f8aa3e60fe1681839833567b5632fe22a
[PATCH] 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: Chris Wright <chrisw@sous-sol.org>
fs/nfs/dir.c