From: Sage Weil Date: Sat, 24 Jul 2010 16:49:52 +0000 (-0700) Subject: osd: helper should reply with ACK on error, op flags on success X-Git-Tag: v0.21~48^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=47fd7fe2f26c7ec09d1ecc01e5b6e4d109b39290;p=ceph.git osd: helper should reply with ACK on error, op flags on success --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index dc8c8e5501ef..b3c8a95e4b25 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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(); }