]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
LFNIndex::created: fix return value with failure injection
authorSamuel Just <sjust@redhat.com>
Thu, 10 Mar 2016 19:06:06 +0000 (11:06 -0800)
committerSamuel Just <sjust@redhat.com>
Mon, 14 Mar 2016 17:25:29 +0000 (10:25 -0700)
See comment for explanation.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/os/filestore/LFNIndex.cc

index 4962d6a269b9456938ab6908765f1d71da0376e8..2151d14b1a241d666c3a6691e74ebbf89586ec8a 100644 (file)
@@ -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;