]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW Zipper - comment setting s->object in website code
authorDaniel Gryniewicz <dang@redhat.com>
Mon, 13 Sep 2021 17:03:18 +0000 (13:03 -0400)
committerDaniel Gryniewicz <dang@redhat.com>
Fri, 17 Sep 2021 13:43:02 +0000 (09:43 -0400)
Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_swift.cc

index 36ba47f2cde9eb447c101fc193d00b2bab9188b6..e4191f0c9888afd7c73125b6b5ee59528ec9461c 100644 (file)
@@ -5023,10 +5023,10 @@ int RGWHandler_REST_S3Website::retarget(RGWOp* op, RGWOp** new_op, optional_yiel
   /*
    * FIXME: if s->object != new_obj, drop op and create a new op to handle
    * operation. Or remove this comment if it's not applicable anymore
+   * dang: This could be problematic, since we're not actually replacing op, but
+   * we are replacing s->object.  Something might have a pointer to it.
    */
-
-  s->object = store->get_object(new_obj);
-  s->object->set_bucket(s->bucket.get());
+  s->object = s->bucket->get_object(new_obj);
 
   return 0;
 }
@@ -5055,6 +5055,9 @@ int RGWHandler_REST_S3Website::serve_errordoc(const DoutPrefixProvider *dpp, int
   getop->if_unmod = NULL;
   getop->if_match = NULL;
   getop->if_nomatch = NULL;
+  /* This is okay.  It's an error, so nothing will run after this, and it can be
+   * called by abort_early(), which can be called before s->object or s->bucket
+   * are set up. Note, it won't have bucket. */
   s->object = store->get_object(errordoc_key);
 
   ret = init_permissions(getop.get(), y);
index 98c0b54a77c996a7be8b69768bf46cd0f0a4c36a..124ce202f1d0dc4fcf316ad2d996d339ab7b43bb 100644 (file)
@@ -2365,6 +2365,9 @@ int RGWSwiftWebsiteHandler::serve_errordoc(const int http_ret,
     }
   } get_errpage_op(store, handler, s, http_ret);
 
+  /* This is okay.  It's an error, so nothing will run after this, and it can be
+   * called by abort_early(), which can be called before s->object or s->bucket
+   * are set up. */
   if (!rgw::sal::Bucket::empty(s->bucket.get())) {
     s->object = s->bucket->get_object(rgw_obj_key(std::to_string(http_ret) + error_doc));
   } else {