From: Casey Bodley Date: Tue, 9 Jan 2018 20:02:19 +0000 (-0500) Subject: rgw: RGWRadosGetOmapKeysCR uses completion return code X-Git-Tag: v12.2.6~131^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1f9d44d66cc4a5a7bcd4d36badbf7a488053ea71;p=ceph.git rgw: RGWRadosGetOmapKeysCR uses completion return code when this operates on a nonexistent object, the osd will reject the request with ENOENT before trying to process the subops. so Objecter will get back a subop return code of 0, try to decode an empty bufferlist into the result and map that subop return code to EIO by using the AioCompletion's return code, we get the correct result of ENOENT instead Signed-off-by: Casey Bodley (cherry picked from commit 2f94f63e705c33c4bf57923d96c747c5c6681e2d) --- diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index edffa8061180..b20016eeedca 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -252,7 +252,7 @@ RGWRadosGetOmapKeysCR::RGWRadosGetOmapKeysCR(RGWRados *_store, map *_entries, int _max_entries) : RGWSimpleCoroutine(_store->ctx()), store(_store), marker(_marker), - entries(_entries), max_entries(_max_entries), rval(0), + entries(_entries), max_entries(_max_entries), obj(_obj), cn(NULL) { set_description() << "set omap keys dest=" << obj << " marker=" << marker; @@ -268,12 +268,21 @@ int RGWRadosGetOmapKeysCR::send_request() { set_status() << "send request"; librados::ObjectReadOperation op; - op.omap_get_vals2(marker, max_entries, entries, nullptr, &rval); + op.omap_get_vals2(marker, max_entries, entries, nullptr, nullptr); cn = stack->create_completion_notifier(); return ref.ioctx.aio_operate(ref.oid, cn->completion(), &op, NULL); } +int RGWRadosGetOmapKeysCR::request_complete() +{ + int r = cn->completion()->get_return_value(); + + set_status() << "request complete; ret=" << r; + + return r; +} + RGWRadosRemoveOmapKeysCR::RGWRadosRemoveOmapKeysCR(RGWRados *_store, const rgw_raw_obj& _obj, const set& _keys) : RGWSimpleCoroutine(_store->ctx()), diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index cb0ba5808973..85d26632ab06 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -413,7 +413,6 @@ class RGWRadosGetOmapKeysCR : public RGWSimpleCoroutine { map *entries; int max_entries; - int rval; rgw_rados_ref ref; rgw_raw_obj obj; @@ -427,10 +426,7 @@ public: map *_entries, int _max_entries); int send_request() override; - - int request_complete() override { - return rval; - } + int request_complete() override; }; class RGWRadosRemoveOmapKeysCR : public RGWSimpleCoroutine {