]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_otp: treat empty header as -ENOENT
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 4 Dec 2017 07:45:31 +0000 (23:45 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 9 Apr 2018 14:01:02 +0000 (07:01 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/cls/otp/cls_otp.cc

index 188345d56d9fc0f77779a18db81aac9cf5102537..d584df66bba8edc8df63ba00f243e3ffae398164 100644 (file)
@@ -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);