it'd be easier for the static analyzer (like GCC), to reason about if
a variable is initialized before being used.
this change also helps to improve the readability, and to silence the
false alarm like:
In file included from ../src/os/bluestore/BlueStore.h:42,
from ../src/os/bluestore/BlueStore.cc:26:
../src/common/bloom_filter.hpp: In member function 'void std::vector<_Tp, _Alloc>::_M_fill_insert(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = bloom_filter; _Alloc = mempool::pool_allocator<mempool::mempool_bluestore_fsck, bloom_filter>]':
../src/common/bloom_filter.hpp:118:46: warning: '*((void*)(& __tmp)+8).bloom_filter::table_size_' may be used uninitialized in this function [-Wmaybe-uninitialized]
118 | mempool::bloom_filter::alloc_byte.deallocate(bit_table_, table_size_);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Kefu Chai <kchai@redhat.com>
this change silences following false positive warning:
In file included from ../src/include/encoding.h:41,
from ../src/kv/KeyValueDB.h:12,
from ../src/os/bluestore/bluestore_common.h:20,
from ../src/os/bluestore/BlueFS.cc:5:
../src/include/denc.h: In function ‘std::enable_if_t<(is_same_v<T, bluefs_extent_t> || is_same_v<T, const bluefs_extent_t>)> _denc_friend(T&, P&) [with T = bluefs_extent_t; P = ceph::buffer::v15_2_0::p$
../src/include/denc.h:639:11: warning: ‘shift’ may be used uninitialized in this function [-Wmaybe-uninitialized]
639 | shift += 7;
| ~~~~~~^~~~
../src/include/denc.h:613:7: note: ‘shift’ was declared here
613 | int shift;
| ^~~~~
Signed-off-by: Kefu Chai <kchai@redhat.com>
replace strict_iecstrtoll(const char *str,..) with
strict_iecstrtoll(std::string_view, ..). which is more convenient.
and both of them share the same implementation:
strict_iec_cast<uint64_t>(str, err);
so they are interchangeable.
Signed-off-by: Kefu Chai <kchai@redhat.com>
strict_sistrtoll() is but an alias of strict_si_cast<uint64_t>(..),
let's just drop the former. there are way too many thin wrappers in
strtol.{h,cc}. they don't offer lots of benefit to us.
Signed-off-by: Kefu Chai <kchai@redhat.com>
they are but proxies to strict_strto*(string_view, ...). and their
callers can just call the latter without any change. so drop these
proxies.
Signed-off-by: Kefu Chai <kchai@redhat.com>
this variant is better than strict_si_cast(const char*), because:
* we can just pass std::string to it, as std::string_view can be
constructed from a std::string implicitly
* strict_si_cast(std::string_view, ..) is the underlying
implementation of strict_si_cast(const char*,..), so less
indirection helps with the readability.
Signed-off-by: Kefu Chai <kchai@redhat.com>
this variant is better than strict_iec_cast(const char*), because:
* we can just pass std::string to it, as std::string_view can be
constructed from a std::string implicitly
* strict_iec_cast(std::string_view, ..) is the underlying
implementation of strict_iec_cast(const char*,..), so less
indirection helps with the readability.
* rgw,mon: use strict_iec_cast(std::string_view, ..) instead.
Signed-off-by: Kefu Chai <kchai@redhat.com>
silences following warning from GCC:
../src/kv/RocksDBStore.cc:386:7: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized]
386 | if (r < 0) {
| ^~
Signed-off-by: Kefu Chai <kchai@redhat.com>
so that reactor does not complain when being stopped, like:
ERROR 2021-07-24 20:50:23,711 [shard 0] seastar - Timer callback failed: seastar::gate_closed_exception (gate closed)
Signed-off-by: Kefu Chai <kchai@redhat.com>
to disable following warning:
In file included from ../src/common/config.h:27,
from ../src/crimson/common/config_proxy.h:8,
from ../src/crimson/osd/main.cc:23:
../src/common/config_values.h: In copy constructor ‘ConfigValues::ConfigValues(const ConfigValues&)’:
../src/common/config_values.h:19:7: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
19 | class ConfigValues {
| ^~~~~~~~~~~~
Signed-off-by: Kefu Chai <kchai@redhat.com>
because fmt is packaged in EPEL, while librados is packaged
in RHEL, so we cannot have fmt as a runtime dependency of librados.
to address this issue, we should compile librados either with static library
or with header-only library of fmt. but because the fedora packaging
guideline does no encourage us to package static libraries, and it would
be complicated to package both static and dynamic library for fmt.
the simpler solution would be to compile Ceph with the header-only
version of fmt.
in this change, we compile ceph with the header-only version of fmt
on RHEL to address the runtime dependency issue.
Signed-off-by: Kefu Chai <kchai@redhat.com>
in this change:
* an interface library named "fmt-header-only" is introduced. it brings
the support to the header only fmt library.
* fmt::fmt is renamed to fmt
* an option named "WITH_FMT_HEADER_ONLY" is introduced
* fmt::fmt is an alias of "fmt-header-only" if "WITH_FMT_HEADER_ONLY"
is "ON", and an alias of "fmt" otherwise.
because fmt is packaged in EPEL, while librados is packaged
in RHEL, so we cannot have fmt as a runtime dependency of librados.
to address this issue an option "WITH_FMT_HEADER_ONLY" is introduced, so
that we can enable it when building Ceph with the header version of fmt.
and the built packages won't have runtime dependency of fmt.
Signed-off-by: Kefu Chai <kchai@redhat.com>
We don't need to run an extra command (mgr module ls) to obtain the mgr
modules list since we already have this information in the mgr_map.
This workflow is already done for the monitoring stack or for configuring
the iscsi integration within the dashboard (during creation) via the
config_dashboard method.
The mgr_map is mocked in the tests with the dashboard module enabled so we
don't need _mon_command_mock_mgr_module_ls anymore.
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
When deploying the grafana service but the mgr dashboard isn't enabled then
dashboard set-grafana-api-ssl-verify command fails.
Closes: https://tracker.ceph.com/issues/51796
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
This log message is not an error and is done on every tick of the
snaptrim process. Replace the derr logging to dout(10) to not log it
by default.
Fixes: https://tracker.ceph.com/issues/51799
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>