IMO problem is the function`int RGWRados::get_obj` that calls the `RGWRados::get_obj_state` which returns '0' even in case if there is no such a file (`obj_stat` returns -ENOENT, see `./src/rgw/rgw_rados.cc` block starting at the line 3886).
One of the following must be done:
1. Change `get_obj_state` so it returns -ENOENT in case if there is no file (i.e. remove the 'return 0' in ENOENT path) (can be dangerous and can break something else)
2. The field `exists` of the `astate` variable must be checked before processing to fetch the object in the `get_obj`.
IMO problem is the function`int RGWRados::get_obj` that calls the `RGWRados: :get_obj_ state` which returns '0' even in case if there is no such a file (`obj_stat` returns -ENOENT, see `./src/ rgw/rgw_ rados.cc` block starting at the line 3886).
One of the following must be done:
1. Change `get_obj_state` so it returns -ENOENT in case if there is no file (i.e. remove the 'return 0' in ENOENT path) (can be dangerous and can break something else)
2. The field `exists` of the `astate` variable must be checked before processing to fetch the object in the `get_obj`.