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.
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.
Kefu Chai [Tue, 17 Jun 2025 08:28:57 +0000 (16:28 +0800)]
cmake: suppress -Wmaybe-uninitialized warning in memstore PageSet
Suppress GCC-15 false positive warning about uninitialized memory in
Page::operator delete() using placement new pattern.
GCC-15 incorrectly warns about potentially uninitialized data when
using placement new with manual memory management:
```
[409/506] Building CXX object src/os/CMakeFiles/os.dir/memstore/MemStore.cc.o
In file included from /home/kefu/dev/ceph/src/os/memstore/MemStore.h:29,
from /home/kefu/dev/ceph/src/os/memstore/MemStore.cc:28:
In static member function ‘static void Page::operator delete(void*)’,
inlined from ‘void Page::put()’ at /home/kefu/dev/ceph/src/os/memstore/PageSet.h:36:41:
/home/kefu/dev/ceph/src/os/memstore/PageSet.h:83:42: warning: ‘*this.Page::data’ may be used uninitialized [-Wmaybe-uninitialized]
83 | delete[] reinterpret_cast<Page*>(p)->data;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
```
The warning is a false positive: Page instances are constructed using
placement new over pre-allocated memory, requiring manual cleanup of
the underlying data array. This is the intended behavior and memory
is properly initialized. So, in this change we just silence this warning
in CMake after checking its availability.
Kefu Chai [Tue, 17 Jun 2025 07:55:27 +0000 (15:55 +0800)]
cmake: build crypto_plugins only when needed for radosgw
Make crypto_plugins a conditional ALL target instead of an explicit
dependency to improve build parallelism.
Background:
- dbbf052f: Added crypto plugins with ceph_crypto_isal as os dependency
- 53726b8e: Changed os to depend on crypto_plugins (not specific plugin)
- Issue:
* crypto_plugins are not dependencys of "os" at all
* crypto_plugins are runtime-only dependencies for rgw_common
In this change:
- Remove crypto_plugins from explicit target dependencies
- Add crypto_plugins to ALL target when WITH_RADOSGW=ON
- Plugins now build in parallel with other targets
- Maintains runtime plugin loading without compile-time coupling
This improves build concurrency by allowing crypto_plugins to build
in parallel with os/rgw_common instead of sequentially, and prevents
building crypto plugins when RadosGW is disabled.
Kefu Chai [Wed, 18 Jun 2025 02:16:26 +0000 (10:16 +0800)]
cmake: link ceph_test_keyvaluedb directly against kv library
Fix incorrect transitive dependency by linking ceph_test_keyvaluedb
directly against the kv library instead of relying on transitive
linkage through the os library.
The test includes headers from kv/KeyValueDB.h and kv/RocksDBStore.h,
which are provided by the kv target, not os. This change makes the
dependency explicit and corrects the build configuration.
Kefu Chai [Tue, 17 Jun 2025 07:33:56 +0000 (15:33 +0800)]
cmake: modularize os/CMakeLists.txt
Split monolithic os target into per-store modules to improve build
system organization and dependency management.
Previously, the "os" target compiled all sources in the os/ directory
as a single unit and linked against all dependencies collectively.
Changes:
- Break os/CMakeLists.txt into smaller, store-specific modules
- Enable per-store compile options and dependency definitions
- Make dependency relationships more explicit and granular
This modularization improves build system maintainability and makes
the codebase structure clearer for future development.
Kefu Chai [Tue, 17 Jun 2025 14:24:29 +0000 (22:24 +0800)]
cmake: explicitly link unittest_rocksdb_option against RocksDB
Previously, unittest_rocksdb_option relied on transitive RocksDB linkage
from the "os" dependency, which was fragile and implicit. Since
unittest_rocksdb_option directly uses RocksDB APIs (including rocksdb/db.h
in TestRocksdbOptionParse.cc), it should explicitly declare this dependency.
This change adds an explicit link to RocksDB::RocksDB, making the build
system more robust and self-contained.