]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: helper should reply with ACK on error, op flags on success
authorSage Weil <sage@newdream.net>
Sat, 24 Jul 2010 16:49:52 +0000 (09:49 -0700)
committerSage Weil <sage@newdream.net>
Sat, 24 Jul 2010 16:49:52 +0000 (09:49 -0700)
src/osd/OSD.cc

index dc8c8e5501ef66bb3553bca599dc9ed1f7e60c1b..b3c8a95e4b25157caf595c8d1ba25d860c095c24 100644 (file)
@@ -4257,7 +4257,15 @@ void OSD::defer_recovery(PG *pg)
 
 void OSD::reply_op_error(MOSDOp *op, int err)
 {
-  MOSDOpReply *reply = new MOSDOpReply(op, err, osdmap->get_epoch(), CEPH_OSD_FLAG_ACK);
+  int flags;
+  if (err == 0)
+    // reply with whatever ack/safe flags the caller wanted
+    flags = op->get_flags() & (CEPH_OSD_FLAG_ACK|CEPH_OSD_FLAG_ONDISK);
+  else
+    // just ACK on error
+    flags = CEPH_OSD_FLAG_ACK;
+
+  MOSDOpReply *reply = new MOSDOpReply(op, err, osdmap->get_epoch(), flags);
   messenger->send_message(reply, op->get_connection());
   op->put();
 }