Kefu Chai [Thu, 19 Jun 2025 10:04:05 +0000 (18:04 +0800)]
rgw: avoid using std::aligned_storage_t
std::aligned_storage_t was deprecated in C++23, to be prepared for it,
let's use alignas for the same behavior. because the 3 * 8 (with LP64
data model) is not power-of-2, while `alignas()` requires an alignment
of power of 2. so we use `std::bit_ceil()` to calculate the minimum
alignment greater or equal to this number.
Kefu Chai [Thu, 19 Jun 2025 09:50:15 +0000 (17:50 +0800)]
common/static_ptr: avoid using std::aligned_storage_t
std::aligned_storage_t was deprecated in C++23, to be prepared for it,
let's use alignas for the same behavior. because the size of `Base`
class is not always power-of-2, while `alignas()` requires an alignment
of power of 2. so we use `std::bit_ceil()` to calculate the minimum
alignment greater or equal to its size.
Kefu Chai [Thu, 19 Jun 2025 08:52:59 +0000 (16:52 +0800)]
neorados: avoid using std::aligned_storage_t
std::aligned_storage_t was deprecated in C++23, to be prepared for
it, let's use alignas for the same behavior. because we do not always
pass a power-of-2 number to `std::aligned_storage_t`, while `alignas()`
requires an alignment of power of 2. so we use `std::bit_ceil()` to
calculate the minimum alignment greater or equal to the given number.
Kefu Chai [Thu, 19 Jun 2025 08:19:04 +0000 (16:19 +0800)]
common/io_exerciser: fix buffer overread in DataGenerator
Fix GCC-15 warning about reading uninitialized memory when copying
random data to fill remaining bytes in generated blocks.
The issue occurred when remainingBytes exceeded the 8-byte size of
the uint64_t rand1 variable, causing memcpy to read beyond the
variable's boundary. While this didn't cause crashes (reading from
stack) and the buffer was still properly filled with rand2, it
violated memory safety and generated compiler warnings.
Fixed by limiting the copy size to the actual size of the source
variable (sizeof(rand1)) to ensure we only read initialized memory.
Resolves GCC-15 warnings:
- DataGenerator.cc:76: memcpy reading 9-15 bytes from 8-byte region
- DataGenerator.cc:108: memcpy reading 9-15 bytes from 8-byte region
Currently, we use the "Check ceph config" CI check to remind users about
any configuration changes that were detected in the PR. There's no easy
way for the script to detect if the relevant docuemtations has been
updated for the config change that was detected.
Users might get confused to still see the CI check failing even after
updating the relevant docs. We update the text message to help diffuse
the confusion. If the users will still like to see the CI check go green
- they can comment `/config check ok` and re-run the failed test.
Yuval Lifshitz [Mon, 16 Jun 2025 11:05:25 +0000 (11:05 +0000)]
rgw/logging: make unique part of log file both random and incremental
new format will be: 10 char incremental count (so 32bit uint fit in it).
and 6 char alphanumeric random part.
this should fix possible race conditions in case of multisite
Kefu Chai [Wed, 18 Jun 2025 13:19:21 +0000 (21:19 +0800)]
ceph-object-corpus: update submodule
Update the ceph-object-corpus submodule to pick up the change to
mark cls_rbd_snap as forward incompatible since nautilus. This change
allows us to update ceph-dencoder to allocate fresh instances for each
decode operation instead of reusing existing ones. The uncoming
change in ceph-dencoder will allow us to identify the potential
compatibility break early.
Kefu Chai [Wed, 18 Jun 2025 09:22:36 +0000 (17:22 +0800)]
deb: use variable expansion to support systemd unit dir changes
Ubuntu changed the systemd unit directory location between releases:
- Jammy (22.04): /lib/systemd/system
- Noble (24.04): /usr/lib/systemd/system
To maintain compatibility across both versions, update .install files
to use brace expansion pattern {usr/,}lib/systemd/system/<service>.
This pattern works because dh_install uses bsd_glob() with GLOB_CSH
flags, which expands braces and matches files in both locations
depending on where CMakeLists.txt actually installed them.
Fixes installation issues when building packages on Noble while
maintaining backward compatibility with Jammy builds.
Kefu Chai [Sat, 14 Jun 2025 13:44:05 +0000 (21:44 +0800)]
cls/rbd: use default values for non-decoded fields in test instances
Previously, test instances for cls_rbd_snap used non-default values
for the "parent" field, which is ignored during decoding. The
check-generated.sh test passed because they reused the same instance
for re-encoding, preserving undecoded fields.
An upcoming change will allocate new instances for each encode/decode
verification instead of reusing instances. This will expose
discrepancies between original test instances and re-encoded values
when fields contain non-default values but aren't decoded.
This change sets ignored fields to their default values in test
instances, ensuring consistency between encoding and decoding
operations regardless of the verification approach used.
Since the incompatibility of cls_rbd_snap's on-disk format was
introduced in 32b14ed1, which was introduced Ceph v14, we will
mark this version the first incompatible version in ceph-object-corpus
in the sense that the re-encoded cls_rbd_snap with v8 struct version
is different from the original copy if its parent field is set with
< v8 struct version.
Kefu Chai [Tue, 17 Jun 2025 09:22:16 +0000 (17:22 +0800)]
cmake: use find_program(REQUIRED) to fail early on missing programs
Since upgrading minimum CMake version to 3.22.1 (commit 469d82a1), we can
now use find_program(REQUIRED) which was introduced in CMake 3.18.
This change replaces manual FATAL_ERROR checks with the REQUIRED option
and adds it to programs that are actually needed during the build. This
ensures the build fails early during configuration rather than later
during compilation when missing programs are invoked.
Changes:
- Replace find_program() + message(FATAL_ERROR) patterns with REQUIRED
- Add REQUIRED to programs that are used during build but previously
had no error checking
Zac Dover [Tue, 17 Jun 2025 06:05:08 +0000 (16:05 +1000)]
doc: mgr/dashboard: add --enable-auth flag
Add an instruction that includes the --enable-auth flag in a "git orch
apply mgmt-gateway" command, in accordance with a request made by
afreen23 here: https://github.com/ceph/ceph/pull/60440#discussion_r1953530599
dependabot[bot] [Tue, 17 Jun 2025 04:56:28 +0000 (04:56 +0000)]
mgr/dashboard: bump vite and @angular-devkit/build-angular
Removes [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). It's no longer used after updating ancestor dependency [@angular-devkit/build-angular](https://github.com/angular/angular-cli). These dependencies need to be updated together.
Removes `vite`
Updates `@angular-devkit/build-angular` from 18.2.11 to 18.2.20
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/18.2.11...18.2.20)
Ramana Raja [Tue, 13 May 2025 16:37:52 +0000 (12:37 -0400)]
pybind/mgr/dashboard: fetch image's mirror mode
... only if the image is not disabled for mirroring.
If the image is disabled for mirroring, fetching the image's
mirroring mode is invalid. So validate that the image is not disabled
for mirroring before fetching the mirroring mode.
Ramana Raja [Tue, 6 May 2025 00:07:18 +0000 (20:07 -0400)]
pybind/mgr/rbd_support: check whether mirroring is enabled
... before fetching the mirroring mode of the image.
In the CreateSnapshotRequests class, which asynchronously issues mirror
snapshot creation requests, prevalidation includes checking that the
image is enabled for snapshot-based mirroring and is marked as primary.
Since mirroring mode can only be queried if mirroring is already
enabled, the code first fetches the image’s mirroring info to verify
that mirroring is enabled, and only then retrieves the mirroring mode.
Ramana Raja [Tue, 6 May 2025 20:19:09 +0000 (16:19 -0400)]
librbd/api/Mirror: return EINVAL from image_resync()
... when mirroring is not enabled for the image.
Mirror::image_resync() returns ENOENT when mirroring is disabled for the
image. Instead, make it return EINVAL indicating that the call is
invalid when mirroring is not enabled for the image. This also causes
the public facing C, C++, and Python APIs that resync an image to
return EINVAL or raise an equivalent exception when mirroring is not
enabled for the image.
Ramana Raja [Mon, 5 May 2025 23:37:42 +0000 (19:37 -0400)]
librbd/mirror/PromoteRequest: return EINVAL
... instead of ENOENT when mirroring is not enabled for the image.
The PromoteRequest async state machine returns ENOENT when mirroring is
not enabled for the image. Instead, make it return EINVAL similar to
DemoteRequest's behavior, which is more appropriate. This also causes
the public facing C, C++, and Python APIs that promote an image
to return EINVAL or raise an equivalent exception when mirroring is
not enabled for the image.
Ramana Raja [Mon, 5 May 2025 17:31:34 +0000 (13:31 -0400)]
librbd/api/Mirror: return EINVAL from image_get_mode()
... when the image is disabled for mirroring.
When an image is disabled for mirroring, fetching the image's
mirroring mode is invalid. So, modify the Mirror::image_get_mode()
internal API to return EINVAL instead of success when mirroring is
disabled.
The Mirror::image_get_mode() method is called by the public C++, C, and
Python APIs that fetch the mirroring mode of an image. The behavior of
these public APIs will change. They will return an error code or raise
an exception indicating that it's an invalid operation to fetch the
image's mirroring mode when mirroring is disabled.
Fixes: https://tracker.ceph.com/issues/71226 Signed-off-by: Ramana Raja <rraja@redhat.com>
nvme-cli has changed json output in 2.11
and then reverted the change in 2.13 release.
So this commit goes back to 2.13 (or pre-2.11)
processing of "nvme list" json output.
Kefu Chai [Fri, 13 Jun 2025 12:22:20 +0000 (20:22 +0800)]
mds: generate symlink inode with correct mode
Fix test instance generation for InodeStoreBare and InodeStore to
properly set the mode field to S_IFLNK for symlink inodes.
Previously, generated test instances with symlink inodes had unset
mode fields, creating inconsistent data. This issue was masked because
ceph-dencoder reused existing instances during encode/decode consistency
tests, leaving stale values intact.
The problem would surface when check-generated.sh and readable.sh
allocate fresh instances for decoding tests, as the missing mode field
would cause decode/encode inconsistencies.
This change fixes generate_test_instances() to set the mode field to
S_IFLNK for symlink inodes, creating valid InodeStore and InodeStoreBare
instances with consistent field values for proper encode/decode testing.
John Mulligan [Fri, 13 Jun 2025 22:05:50 +0000 (18:05 -0400)]
pybind/mgr: disable mypy error in diskprediction_local module
Currently on python 3.12 mypy detects one of the variables used in the
expression as an zero-element tuple. This module is not getting a lot
of attention so I'm doing the bare minimum to stop the tests from
failing here and silencing mypy with a magic comment.
Signed-off-by: John Mulligan <jmulligan@redhat.com>