]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: allow CMPXATTR ops to trigger side effects too 8640/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 18 Apr 2016 08:55:29 +0000 (16:55 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 18 Apr 2016 13:42:29 +0000 (21:42 +0800)
This is for:
1. during the do_osd_ops() process, it may return 1 when processing
a CEPH_OSD_OP_CMPXATTR/CEPH_OSD_OP_SRC_CMPXATTR message to indicate
that the comparison result is positive. Therefore, the do_osd_ops()
method may also be able to return a value which is bigger than 0.
2. the ReplicatedPG::execute_ctx() method will try to catch any reads
operation and trigger do_osd_op_effects() on success, as below:

    // read or error?
    if (ctx->op_t->empty() || result < 0)
    {
        // finish side-effects
        if (result == 0)
            do_osd_op_effects(ctx, m->get_connection());

Thus we may don't call do_osd_op_effects() as expected if result is bigger
than 0 and op is not write.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/ReplicatedPG.cc

index be65e6ed7146c4531327368e7daf24911eeacc94..c63178008c0ddd32fb04e202d83be5ac448bbae6 100644 (file)
@@ -2987,7 +2987,7 @@ void ReplicatedPG::execute_ctx(OpContext *ctx)
   // read or error?
   if (ctx->op_t->empty() || result < 0) {
     // finish side-effects
-    if (result == 0)
+    if (result >= 0)
       do_osd_op_effects(ctx, m->get_connection());
 
     if (ctx->pending_async_reads.empty()) {