From: Yehuda Sadeh Date: Mon, 4 Dec 2017 07:45:31 +0000 (-0800) Subject: cls_otp: treat empty header as -ENOENT X-Git-Tag: v13.1.0~343^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=63924ef625479fd248d299ffbc8bab940f0e7bc7;p=ceph.git cls_otp: treat empty header as -ENOENT Signed-off-by: Yehuda Sadeh --- diff --git a/src/cls/otp/cls_otp.cc b/src/cls/otp/cls_otp.cc index 188345d56d9f..d584df66bba8 100644 --- a/src/cls/otp/cls_otp.cc +++ b/src/cls/otp/cls_otp.cc @@ -228,6 +228,11 @@ static int read_header(cls_method_context_t hctx, otp_header *h) return r; } + if (bl.length() == 0) { + *h = otp_header(); + return 0; + } + auto iter = bl.begin(); try { ::decode(*h, iter);