Skip to content

Commit c53f3bc

Browse files
committed
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 <[email protected]>
1 parent 80bcefa commit c53f3bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rgw/rgw_file.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,10 @@ namespace rgw {
901901
}
902902
break;
903903
default:
904+
if (unlikely(rgw_fh->is_bucket())) {
905+
/* treat buckets like immutable, namespace roots */
906+
return 0; /* it's not an error, we just won't do it */
907+
}
904908
break;
905909
};
906910

0 commit comments

Comments
 (0)