]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix cmpext bug
authorwangzhengyong <wangzhengyong@cmss.chinamobile.com>
Mon, 12 Jun 2017 13:23:36 +0000 (21:23 +0800)
committerJason Dillaman <dillaman@redhat.com>
Fri, 21 Jul 2017 13:35:04 +0000 (09:35 -0400)
Signed-off-by: Zhengyong Wang <wangzhengyong@cmss.chinamobile.com>
src/osd/PrimaryLogPG.cc

index da2f533fa4bd9cf0b5ee96c15eb460f2f125b20e..dca6fcf9fbb8feb9e11b164fd58a72627324206c 100644 (file)
@@ -4056,12 +4056,14 @@ int PrimaryLogPG::do_extent_cmp(OpContext *ctx, OSDOp& osd_op)
     return result;
   }
 
-  if (read_op.outdata.length() != osd_op.indata.length())
-    return -EINVAL;
-
   for (uint64_t p = 0; p < osd_op.indata.length(); p++) {
-    if (read_op.outdata[p] != osd_op.indata[p]) {
-      return (-MAX_ERRNO - p);
+    if (p >= read_op.outdata.length()) {
+      if (osd_op.indata[p] != 0)
+        return (-MAX_ERRNO - p);
+    } else {
+      if (read_op.outdata[p] != osd_op.indata[p]) {
+        return (-MAX_ERRNO - p);
+      }
     }
   }