From: Samuel Just Date: Thu, 10 Mar 2016 19:06:06 +0000 (-0800) Subject: LFNIndex::created: fix return value with failure injection X-Git-Tag: v0.94.8~51^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b821cc8f394e59760e3d58d27f382976bb69e13;p=ceph.git LFNIndex::created: fix return value with failure injection See comment for explanation. Signed-off-by: Samuel Just (cherry picked from commit aec5560887a1c1dbbb5aba822280e2c1e05d5d8f) --- diff --git a/src/os/LFNIndex.cc b/src/os/LFNIndex.cc index 5d6bd7b9d8d7..2658e9929b81 100644 --- a/src/os/LFNIndex.cc +++ b/src/os/LFNIndex.cc @@ -89,8 +89,19 @@ int LFNIndex::created(const ghobject_t &oid, const char *path) if (r < 0) goto out; r = lfn_created(path_comp, oid, short_name); - if (r < 0) + if (r < 0) { + if (failed) { + /* This is hacky, but the only way we get ENOENT from lfn_created here is + * if we did a failure injection in _created below AND actually started the + * split or merge. In that case, lfn_created already suceeded, and + * WRAP_RETRY already cleaned it up and we are actually done. In a real + * failure, the filestore itself would have ended up calling this with + * the new path, not the old one, so we'd find it. + */ + r = 0; + } goto out; + } r = _created(path_comp, oid, short_name); if (r < 0) goto out;