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 <mbenjamin@redhat.com>
This commit is contained in:
Matt Benjamin 2023-06-20 15:31:26 -04:00
parent 80bcefadf7
commit c53f3bc319

View 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;
};