]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fetch_remote_obj() fix handling of ERR_NOT_MODIFIED 8284/head
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 24 Mar 2016 22:07:27 +0000 (15:07 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 24 Mar 2016 22:10:26 +0000 (15:10 -0700)
got broken when disabled opstate

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc

index 16d451c2f6349fe7edd8e1e023e19fb7df4fdcee..448263be08a1291777180c1d0765fc858e3d342b 100644 (file)
@@ -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) {