• Trond Myklebust's avatar
    NFS: nfs_lookup - don't hash dentry when optimising away the lookup · 1488da20
    Trond Myklebust authored
    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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
    Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
    1488da20
dir.c 44.3 KB