]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: `radosgw-admin bucket stats` on indexless bucket crashes
authorJ. Eric Ivancich <ivancich@redhat.com>
Thu, 23 Dec 2021 21:25:26 +0000 (16:25 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 28 Apr 2022 17:24:30 +0000 (13:24 -0400)
commitea2db1411c6243a527882942fe8b02d0af9a9440
tree9b52be4121e5de40a0aa55c2b762a9ff30d72d25
parent68d895cb8c89bf6eb4c2bc7c37a03162cf3a5964
rgw: `radosgw-admin bucket stats` on indexless bucket crashes

The new bucket layout code didn't check whether the bucket is
indexless prior to asking for the last entry in the layout log. The
layout log appears to be empty for an indexless bucket, thereby
putting the runtime in an undefined state that later may cause a
failed assertion.

This commit adds two safety checks and returns -EINVAL along with
putting useful information on stderr when either stats are requested
on an indexless bucket or when the layout log is empty.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/rgw/rgw_bucket.cc