From: Yehuda Sadeh Date: Thu, 24 Mar 2016 22:07:27 +0000 (-0700) Subject: rgw: fetch_remote_obj() fix handling of ERR_NOT_MODIFIED X-Git-Tag: v10.1.1~86^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F8284%2Fhead;p=ceph.git rgw: fetch_remote_obj() fix handling of ERR_NOT_MODIFIED got broken when disabled opstate Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 16d451c2f634..448263be08a1 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -6571,11 +6571,15 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx, return 0; set_err_state: + if (copy_if_newer && ret == -ERR_NOT_MODIFIED) { + ret = 0; + } if (opstate) { - RGWOpState::OpState state = RGWOpState::OPSTATE_ERROR; - if (copy_if_newer && ret == -ERR_NOT_MODIFIED) { + RGWOpState::OpState state; + if (ret < 0) { + state = RGWOpState::OPSTATE_ERROR; + } else { state = RGWOpState::OPSTATE_COMPLETE; - ret = 0; } int r = opstate->set_state(state); if (r < 0) {