]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: If object exist and not whiteout, don't do touch for 6007/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Mon, 21 Sep 2015 06:12:39 +0000 (14:12 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Mon, 21 Sep 2015 06:12:39 +0000 (14:12 +0800)
create.

Also, if object is whiteout, it need transaction op to update xattr
which chanage whiteout to no-whiteout. For this we can use nop rather
that touch.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/osd/ReplicatedPG.cc

index cfda5b00dfd8f83c26595b1ca6242189bcfdaff8..cc2c26879bcf35b7a2428d852fc83e693ef34ea0 100644 (file)
@@ -4764,10 +4764,12 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
            // category is no longer implemented.
          }
           if (result >= 0) {
+           bool is_whiteout = obs.exists && oi.is_whiteout();
            if (maybe_create_new_object(ctx)) {
-              ctx->mod_desc.create();
-           }
-            t->touch(soid);
+             ctx->mod_desc.create();
+             t->touch(soid);
+           } else if (is_whiteout) //change whiteout to non-whiteout, it need a op to update xattr.
+             t->nop();
           }
        }
       }