Skip to content
Commit f39c0104 authored by NeilBrown's avatar NeilBrown Committed by Trond Myklebust
Browse files

NFS: remove BUG possibility in nfs4_open_and_get_state



commit 4fa2c54b
    NFS: nfs4_do_open should add negative results to the dcache.

used "d_drop(); d_add();" to ensure that a dentry was hashed
as a negative cached entry.
This is not safe if the dentry has an non-NULL ->d_inode.
It will trigger a BUG_ON in d_instantiate().
In that case, d_delete() is needed.

Also, only d_add if the dentry is currently unhashed, it seems
pointless removed and re-adding it unchanged.

Reported-by: default avatarChristoph Hellwig <hch@infradead.org>
Fixes: 4fa2c54b
Cc: Jeff Layton <jeff.layton@primarydata.com>
Link: http://lkml.kernel.org/r/20140908144525.GB19811@infradead.org


Signed-off-by: default avatarNeilBrown <neilb@suse.de>
Acked-by: default avatarJeff Layton <jlayton@primarydata.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 224ecbf5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment