From c53f3bc3197ff23eff992fdfe5af1879aab8745f Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Tue, 20 Jun 2023 15:31:26 -0400 Subject: [PATCH] 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 --- src/rgw/rgw_file.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index 5b61583090e..6a55d3f1d8f 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; };