From 1f9d44d66cc4a5a7bcd4d36badbf7a488053ea71 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 9 Jan 2018 15:02:19 -0500 Subject: [PATCH] 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) --- src/rgw/rgw_cr_rados.cc | 13 +++++++++++-- src/rgw/rgw_cr_rados.h | 6 +----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index edffa8061180c..b20016eeedcad 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 cb0ba58089732..85d26632ab064 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 { -- 2.39.5