]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: correct the if case to handle exceptional case
authormyoungwon oh <ohmyoungwon@gmail.com>
Wed, 2 Dec 2020 02:48:37 +0000 (11:48 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Wed, 2 Dec 2020 02:48:37 +0000 (11:48 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsumg.com>
src/osd/PrimaryLogPG.cc

index cdeca5150728dcf95c26704edb98633154257c4a..0831fa8fb05795a56cd3b24627855d7c36635a46 100644 (file)
@@ -10124,9 +10124,10 @@ int PrimaryLogPG::do_cdc(const object_info_t& oi,
             << " len: " << oi.size << " r: " << r << dendl;
     return r;
   }
-  if (bl.length() == 0) {
-    dout(0) << __func__ << " got 0 byte during chunking " << dendl;
-    return r;
+  if (bl.length() != oi.size) {
+    dout(0) << __func__ << " bl.length: " << bl.length() << " != oi.size: "
+           << oi.size << " during chunking " << dendl;
+    return -ENODATA;
   }
 
   dout(10) << __func__ << " oid: " << oi.soid << " len: " << bl.length()