NeilBrown f39c010479 NFS: remove BUG possibility in nfs4_open_and_get_state
commit 4fa2c54b5198d09607a534e2fd436581064587ed
    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: Christoph Hellwig <hch@infradead.org>
Fixes: 4fa2c54b5198d09607a534e2fd436581064587ed
Cc: Jeff Layton <jeff.layton@primarydata.com>
Link: http://lkml.kernel.org/r/20140908144525.GB19811@infradead.org
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2014-09-12 13:10:53 -04:00
..
2013-06-08 16:20:18 -04:00
2014-07-12 18:22:58 -04:00
2014-07-12 18:22:58 -04:00
2014-08-13 18:13:19 -06:00
2014-08-13 18:13:19 -06:00
2013-11-15 13:41:43 -05:00
2012-07-30 19:06:41 -04:00
2014-08-26 16:17:48 -04:00
2014-07-12 18:43:47 -04:00
2012-07-30 19:06:52 -04:00
2014-08-13 18:13:19 -06:00
2014-08-03 17:05:25 -04:00
2014-06-24 18:47:00 -04:00
2014-06-25 19:01:27 -04:00