From: Casey Bodley Date: Tue, 9 Jan 2018 20:02:19 +0000 (-0500) Subject: rgw: RGWRadosGetOmapKeysCR uses completion return code X-Git-Tag: v13.0.2~513^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f94f63e705c33c4bf57923d96c747c5c6681e2d;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 --- diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index 71586bdce6f..32325528baa 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() << "get 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 cb0ba580897..85d26632ab0 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 {