From b2246226cc11fcd87b4fd499c34434f82ca18654 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Wed, 16 Aug 2017 14:56:59 +0200 Subject: [PATCH] rgw: rgw_op: exit early if object has no attrs in GetObjectTagging Check for the return value of get_obj_attrs and exit earlier in case of errors Fixes: http://tracker.ceph.com/issues/21010 Signed-off-by: Abhishek Lekshmanan --- src/rgw/rgw_op.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 985076c7224..ad663973620 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -720,6 +720,12 @@ void RGWGetObjTags::execute() store->set_atomic(s->obj_ctx, obj); op_ret = get_obj_attrs(store, s, obj, attrs); + if (op_ret < 0) { + ldout(s->cct, 0) << "ERROR: failed to get obj attrs, obj=" << obj + << " ret=" << op_ret << dendl; + return; + } + auto tags = attrs.find(RGW_ATTR_TAGS); if(tags != attrs.end()){ has_tags = true; -- 2.39.5