From dc1a052b7d2511ee53072366933ac93cfc79bad6 Mon Sep 17 00:00:00 2001 From: myoungwon oh Date: Wed, 2 Dec 2020 11:48:37 +0900 Subject: [PATCH] osd: correct the if case to handle exceptional case Signed-off-by: Myoungwon Oh --- src/osd/PrimaryLogPG.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index cdeca5150728d..0831fa8fb0579 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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() -- 2.39.5