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: v10.1.0~76^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aec5560887a1c1dbbb5aba822280e2c1e05d5d8f;p=ceph.git LFNIndex::created: fix return value with failure injection See comment for explanation. Signed-off-by: Samuel Just --- diff --git a/src/os/filestore/LFNIndex.cc b/src/os/filestore/LFNIndex.cc index 4962d6a269b9..2151d14b1a24 100644 --- a/src/os/filestore/LFNIndex.cc +++ b/src/os/filestore/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;