]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWRadosGetOmapKeysCR uses completion return code
authorCasey Bodley <cbodley@redhat.com>
Tue, 9 Jan 2018 20:02:19 +0000 (15:02 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 9 May 2018 16:57:11 +0000 (12:57 -0400)
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 <cbodley@redhat.com>
(cherry picked from commit 2f94f63e705c33c4bf57923d96c747c5c6681e2d)

src/rgw/rgw_cr_rados.cc
src/rgw/rgw_cr_rados.h

index edffa8061180c32092a940e9ae79c6d1b4d73f04..b20016eeedcad4d867d4700ee9208ef75cf28e00 100644 (file)
@@ -252,7 +252,7 @@ RGWRadosGetOmapKeysCR::RGWRadosGetOmapKeysCR(RGWRados *_store,
                       map<string, bufferlist> *_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<string>& _keys) : RGWSimpleCoroutine(_store->ctx()),
index cb0ba580897328069d84b7cab7bfb3fe23ad6dd2..85d26632ab0641f4bc4e5a55f64e3d361814b58c 100644 (file)
@@ -413,7 +413,6 @@ class RGWRadosGetOmapKeysCR : public RGWSimpleCoroutine {
   map<string, bufferlist> *entries;
   int max_entries;
 
-  int rval;
   rgw_rados_ref ref;
 
   rgw_raw_obj obj;
@@ -427,10 +426,7 @@ public:
                      map<string, bufferlist> *_entries, int _max_entries);
 
   int send_request() override;
-
-  int request_complete() override {
-    return rval;
-  }
+  int request_complete() override;
 };
 
 class RGWRadosRemoveOmapKeysCR : public RGWSimpleCoroutine {