Skip to content

Commit

Permalink
rgwlc: fix error return from backward-compat decode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mattbenjamin committed Jul 22, 2020
1 parent 3252ab2 commit 91b3d3b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cls/rgw/cls_rgw.cc
Expand Up @@ -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 {
decode(oe, iter);
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);
}
Expand Down

0 comments on commit 91b3d3b

Please sign in to comment.