]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/file: make setattr(...) a no-op on buckets 52144/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 20 Jun 2023 19:31:26 +0000 (15:31 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Thu, 28 Sep 2023 13:55:25 +0000 (09:55 -0400)
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 <mbenjamin@redhat.com>
src/rgw/rgw_file.cc

index 5b61583090eec122b654beeb045b00793b30719a..6a55d3f1d8f508d810d86693ab232350ed78f9a6 100644 (file)
@@ -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;
     };