Introduced by
fc80c1dc6ee315ae5e039986602ffadba46cb43b,
the client should _not_ fail if the lookup for the
destination path on rename returns ENOENT.
The previous code also did not check that the lookup
returned ENOENT or success. We add the check and fail
if we get any other errors.
Fixes #4517.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Inode *otherin;
res = _lookup(todir, toname, &otherin);
- if (res < 0)
+ if (res != 0 && res != -ENOENT)
goto fail;
req->set_other_inode(otherin);
req->other_inode_drop = CEPH_CAP_LINK_SHARED | CEPH_CAP_LINK_EXCL;