]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Filer: return error codes from probing up to the calling layer.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 20 Jul 2011 21:16:56 +0000 (14:16 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 20 Jul 2011 22:58:40 +0000 (15:58 -0700)
This is pretty limited; if you get multiple errors in one batch
of probes it'll only return the last one to get sent back (ENOENT is
excluded). But it's better than nothing.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/osdc/Filer.cc

index f3999891d9ab2b10f4aca8877a26cb4fad98ec51..a33653ce49f805f4f9d5cb55d42c6efe8b02dbab 100644 (file)
@@ -45,7 +45,8 @@ public:
     }
 
     // TODO: handle this error.
-    assert(r == 0);
+    if (r != 0)
+      probe->err = r;
 
     filer->_probed(probe, oid, size, mtime);
   }  
@@ -128,6 +129,12 @@ void Filer::_probed(Probe *probe, const object_t& oid, uint64_t size, utime_t mt
   if (!probe->ops.empty()) 
     return;  // waiting for more!
 
+  if (probe->err) { // we hit an error, propagate back up
+    probe->onfinish->finish(probe->err);
+    delete probe->onfinish;
+    delete probe;
+  }
+
   // analyze!
   uint64_t end = 0;