client: add debugging around traceless reply failures

Tracking down #5021

Signed-off-by: Sage Weil <sage@inktank.com>
client: leave NULL dentry in place on ENOENT during lookup

If we get a NULL lookup result, unlink the inode but leave the dentry
in place.

Signed-off-by: Sage Weil <sage@inktank.com>
client: avoid blindly removing dentries

MetaRequests may have references to these dentries.  Instead of removing
them and tearing down the directory, just unlink them from the inodes.

We could be a bit smarter here if we looked at the reference count, but
this works too.

Signed-off-by: Sage Weil <sage@inktank.com>
client: handle traceless rename in insert_trace, not verify_reply_trace

The insert_trace() logic is about managing local cache consistency; the
verify_reply_trace() is about retrying requests to get the results that
our callers need.

Set up stubs to handle rmdir and unlink while we are here.

Signed-off-by: Sage Weil <sage@inktank.com>
client: skip insert_trace on safe requests

Only do this for the first reply.

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: refactor _lookup; fix NULL dentry case

Return ENOENT for a valid NULL dentry in our cache.  Restructure _lookup
to avoid duplicating some code.

Signed-off-by: Sage Weil <sage@inktank.com>
client: do not manually clean up on unlink/rmdir

The reply handler will do this in a safe, ordered fashion.

Signed-off-by: Sage Weil <sage@inktank.com>
client: unlink dentry on traceless rmdir, unlink reply

This used to be handled in _unlink() and _rmdir() even when a trace was
present in the reply, but this is cleaner.

Signed-off-by: Sage Weil <sage@inktank.com>
client: audit unlink() callers

Basically, always keep the dentry and dir, unless we are pruning.

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: invalidate dentry leases when unlinking

In many case when we are unlinking inodes we also need to invalidate the
dentry lease, as we are not promised that the dentry is NULL.  Be a bit
over-conservative here for good measure.

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: make less noise when unlinking during readdir

Skip, but do not talk about, NULL dentries.

Signed-off-by: Sage Weil <sage@inktank.com>
client: use __func__ instead of incorrect function name in insert_readdir_results

Signed-off-by: Sage Weil <sage@inktank.com>
client: fix whitespace in stat relpath

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #1771 from ceph/wip-5021

Wip 5021

Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>