Skip to content

Commit

Permalink
rgw: fix read not exists null version return wrong
Browse files Browse the repository at this point in the history
steps
1.enable bucket versioning
2.PUT obj (got version XXX)
3.GET obj with version_id=null (return success and have no data)

Fixes: http://tracker.ceph.com/issues/38811

Signed-off-by: Tianshan Qu <tianshan@xsky.com>
(cherry picked from commit a37467f)
  • Loading branch information
tianshan authored and Prashant D committed Apr 1, 2019
1 parent 64524b5 commit c85af37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rgw/rgw_rados.cc
Expand Up @@ -9665,6 +9665,10 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket

if (need_follow_olh) {
return get_olh_target_state(*rctx, bucket_info, obj, s, state);
} else if (obj.key.have_null_instance() && !s->has_manifest) {
// read null version, and the head object only have olh info
s->exists = false;
return -ENOENT;
}
}

Expand Down

0 comments on commit c85af37

Please sign in to comment.