Skip to content

Commit b84d9fe

Browse files
authored
Merge pull request ceph#61136 from cbodley/wip-69301
rgw: don't use merge_and_store_attrs() when recreating a bucket Reviewed-by: Pritha Srivastava <[email protected]> Reviewed-by: Daniel Gryniewicz <[email protected]>
2 parents ef0dfeb + 340e353 commit b84d9fe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/rgw/rgw_op.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3780,7 +3780,10 @@ void RGWCreateBucket::execute(optional_yield y)
37803780
s->bucket->get_info().has_website = !s->bucket->get_info().website_conf.is_empty();
37813781

37823782
/* This will also set the quota on the bucket. */
3783-
op_ret = s->bucket->merge_and_store_attrs(this, createparams.attrs, y);
3783+
s->bucket->set_attrs(std::move(createparams.attrs));
3784+
constexpr bool exclusive = false; // overwrite
3785+
constexpr ceph::real_time no_set_mtime{};
3786+
op_ret = s->bucket->put_info(this, exclusive, no_set_mtime, y);
37843787
} while (op_ret == -ECANCELED && tries++ < 20);
37853788

37863789
/* Restore the proper return code. */
@@ -5181,7 +5184,10 @@ void RGWPutMetadataBucket::execute(optional_yield y)
51815184
/* Setting attributes also stores the provided bucket info. Due
51825185
* to this fact, the new quota settings can be serialized with
51835186
* the same call. */
5184-
op_ret = s->bucket->merge_and_store_attrs(this, attrs, s->yield);
5187+
s->bucket->set_attrs(attrs);
5188+
constexpr bool exclusive = false; // overwrite
5189+
constexpr ceph::real_time no_set_mtime{};
5190+
op_ret = s->bucket->put_info(this, exclusive, no_set_mtime, s->yield);
51855191
return op_ret;
51865192
}, y);
51875193
}

0 commit comments

Comments
 (0)