]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgwlc: fix error return from backward-compat decode
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 22 Jul 2020 17:58:00 +0000 (13:58 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 22 Jul 2020 21:08:51 +0000 (17:08 -0400)
Exception handling in backward-compat case returned EIO even when
the actual backward-compat decode succeeded.

Fixes: https://tracker.ceph.com/issues/46677
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/cls/rgw/cls_rgw.cc

index b05849763e31dbd496bb1dec8d9e5037e2c8ea7d..e38bede11dc5a73585b7053e094610d162803d80 100644 (file)
@@ -3775,13 +3775,14 @@ static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in,
       /* try backward compat */
       pair<string, int> oe;
       try {
+       iter = it->second.begin();
        decode(oe, iter);
        entry = {oe.first, 0 /* start */, uint32_t(oe.second)};
       } catch(buffer::error& err) {
        CLS_LOG(
          1, "ERROR: rgw_cls_lc_list_entries(): failed to decode entry\n");
+       return -EIO;
       }
-      return -EIO;
     }
    op_ret.entries.push_back(entry);
   }