From: Matt Benjamin Date: Tue, 20 Jun 2023 19:31:26 +0000 (-0400) Subject: rgw/file: make setattr(...) a no-op on buckets X-Git-Tag: v19.0.0~363^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c53f3bc3197ff23eff992fdfe5af1879aab8745f;p=ceph.git rgw/file: make setattr(...) a no-op on buckets Shallow fix for apparent unstable behavior after nfs "chown" on an RGW bucket via RGW NFS. While we allow buckets to be created (and subject to ordinary rules, deleted), chown against a bucket hasn't been tested and potentially is not valid. Prevent it altogether for now--if permissions would allow it, chown will succeed but won't have any effect. Fixes: https://tracker.ceph.com/issues/61689 Signed-off-by: Matt Benjamin --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index 5b61583090ee..6a55d3f1d8f5 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -901,6 +901,10 @@ namespace rgw { } break; default: + if (unlikely(rgw_fh->is_bucket())) { + /* treat buckets like immutable, namespace roots */ + return 0; /* it's not an error, we just won't do it */ + } break; };