Skip to content

Commit 462edf3

Browse files
committed
rgw/logging: source and log bucket must be different
Signed-off-by: Yuval Lifshitz <[email protected]>
1 parent cc1a0e5 commit 462edf3

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

doc/radosgw/bucket_logging.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ The log bucket can accumulate logs from multiple buckets. It is recommended to c
1515
a different "prefix" for each bucket, so that the logs of different buckets will be stored
1616
in different objects in the log bucket.
1717

18+
.. note::
19+
20+
- The log bucket must be created before enabling logging on a bucket
21+
- The log bucket cannot be the same as the bucket being logged
22+
- The log bucket cannot have logging enabled on it
23+
1824

1925
.. toctree::
2026
:maxdepth: 1

src/rgw/rgw_rest_bucket_logging.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ class RGWPutBucketLoggingOp : public RGWDefaultResponseOp {
181181
return;
182182
}
183183
const rgw_bucket target_bucket_id(target_tenant_name, target_bucket_name);
184+
if (target_bucket_id == src_bucket_id) {
185+
ldpp_dout(this, 1) << "ERROR: target bucket '" << target_bucket_id << "' must be different from source bucket" << dendl;
186+
op_ret = -EINVAL;
187+
return;
188+
}
184189
std::unique_ptr<rgw::sal::Bucket> target_bucket;
185190
op_ret = driver->load_bucket(this, target_bucket_id,
186191
&target_bucket, y);

0 commit comments

Comments
 (0)