From aec5560887a1c1dbbb5aba822280e2c1e05d5d8f Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 10 Mar 2016 11:06:06 -0800 Subject: [PATCH] LFNIndex::created: fix return value with failure injection See comment for explanation. Signed-off-by: Samuel Just --- src/os/filestore/LFNIndex.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/os/filestore/LFNIndex.cc b/src/os/filestore/LFNIndex.cc index 4962d6a269b..2151d14b1a2 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; -- 2.47.3