Kefu Chai [Tue, 24 Jun 2025 14:38:13 +0000 (22:38 +0800)]
rbd: fix unused function warning when WITH_KRBD is disabled
Guard print_error_description() and get_unsupported_features() with
`#ifdef WITH_KRBD` to prevent compiler warnings when KRBD support is
not enabled.
These functions are only called by do_kernel_map(), which is itself
conditionally compiled. When WITH_KRBD is not defined, the compiler
generates unused function warnings for these helper functions.
Fixes warning:
```
/home/kefu/dev/ceph/src/tools/rbd/action/Kernel.cc:305:13: warning: ‘void rbd::action::kernel::print_error_description(const char*, const char*, const char*, const char*, int)’ defined but not used [-Wunused-function]
305 | static void print_error_description(const char *poolname,
| ^~~~~~~~~~~~~~~~~~~~~~~
```
Nitzan Mordechai [Wed, 21 May 2025 11:41:01 +0000 (11:41 +0000)]
src/mon/MgrStatMonitor: fix invalid iterator increment in calc_pool_availability()
Erasing entries from `pool_availability` inside a range-for
loop invalidated the hidden iterator, triggering an
“Invalid read” under Valgrind.
- Use `std::erase_if(pool_availability, predicate)` for
atomic removal.
- Refactor the stats-update loop to use structured bindings
and a clear `++it` for readability.
John Mulligan [Fri, 20 Jun 2025 23:03:22 +0000 (19:03 -0400)]
script/build-with-container: add rocky10 to built-in distros
Add "rocky10" (also aliased to "rockylinux10") to the known distro bases
so that the team can begin to experiment with the Rocky Linux 10 distro
for containerized builds.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Fri, 20 Jun 2025 23:46:16 +0000 (19:46 -0400)]
script/build-with-container: support --build-arg arguments
Allow passing --build-arg arguments to build-with-container.py
which are passed directly to the container build command.
This allows a developer to toggle certain features of the build
container, however this should not be used in CI.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Fri, 20 Jun 2025 23:34:45 +0000 (19:34 -0400)]
Dockerfile.build: make WITH_CRIMSON a build arg
We've chosen to enable crimson by default to match the CI, but that
is not always something a developer may want, so make WITH_CRIMSON
a build argument that can be toggled off if necessary.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Kefu Chai [Fri, 20 Jun 2025 23:00:01 +0000 (07:00 +0800)]
common/static_ptr: pass an integer to alignas to fix GCC-11 build failure
GCC-11 fails to compile `alignas(std::bit_ceil(Size))` despite std::bit_ceil()
being marked constexpr in libstdc++11. The compiler doesn't recognize it as a
constant expression, while GCC-12+ and Clang-14+ handle it correctly.
Define the alignment value as a separate constexpr variable before passing it
to alignas() to ensure compatibility with GCC-11.
Fixes compilation issue introduced in commit 73399b05 when std::aligned_storage_t
was replaced with alignas.
J. Eric Ivancich [Fri, 20 Jun 2025 20:00:54 +0000 (14:00 -0600)]
Merge pull request #63271 from rafaelweingartner/parameter_to_externalize_secret_key_ttl-upstream-2
rgw: Externalize Keystone secret key cache TTL
Reviewed-by: Matt Benjamin <mbenjamin@redhat.com> Reviewed-by: Adam C. Emerson <aemerson@redhat.com> Reviewed-by: Tobias Urdin <tobias.urdin@binero.com>
Ronen Friedman [Thu, 19 Jun 2025 15:27:38 +0000 (10:27 -0500)]
osd/scrub: clarify that osd_scrub_auto_repair_num_errors counts objects
'osd_scrub_auto_repair_num_errors' limits the number of damaged objects
that we will try to auto-repair during a scrub. Its documentation
referred to "number of errors", which did not fit the implementation.
Fixes: https://tracker.ceph.com/issues/71754 Fixes: Red Hat BZ2316244 Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
Jon [Thu, 19 Jun 2025 14:16:36 +0000 (15:16 +0100)]
test/osd: Make error messages that occur based on configuration problems or user error more readable in ceph_test_rados_io_sequence
Move away from using ceph_abort for error messages that occur from configuration issues and user error to printing to std::error as it is not necissairy to produce a call stack and core dumps in these cases and much better to give an easily readable message to the user.
Signed-off-by: Jon Bailey <jonathan.bailey1@ibm.com>
Jon [Thu, 19 Jun 2025 14:14:04 +0000 (15:14 +0100)]
test/osd: Add erasure code plugins as a dependancy of ceph_test_rados_io_sequence
ceph_test_rados_io_sequence uses the plugins for determining erasure code values for testing, so we want these to be built as a dependancy of the application when built in isolation
Signed-off-by: Jon Bailey <jonathan.bailey1@ibm.com>
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.
Venky Shankar [Tue, 20 May 2025 12:19:41 +0000 (12:19 +0000)]
client: do not check file size when inode does not have Fc caps
Since the client is holding Fr caps, the read request can be
directly sent to the OSD. The offset/in->size comparison check
is causing the read request to return with no data since in->size
isn't yet updated when another client does an extending write.
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.
Venky Shankar [Tue, 27 May 2025 07:26:12 +0000 (07:26 +0000)]
qa/cephfs: ignore `OSD_DOWN/osds down` warning
Runs have started failing a lot with the human friendly variant
of the warning. OSD_DOWN is in the ignore list, however, the human
friendly warning (osds down) isn't.