---------- Forwarded message ---------
From: <scan-admin@xxxxxxxxxxxx>
Date: Fri, Jan 12, 2024 at 4:15 PM
Subject: New Defects reported by Coverity Scan for ceph
To: <kkeithle@xxxxxxxxxx>
From: <scan-admin@xxxxxxxxxxxx>
Date: Fri, Jan 12, 2024 at 4:15 PM
Subject: New Defects reported by Coverity Scan for ceph
To: <kkeithle@xxxxxxxxxx>
Hi,
Please find the latest report on new defect(s) introduced to ceph found with Coverity Scan.
552 new defect(s) introduced to ceph found with Coverity Scan.
300 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 20 of 552 defect(s)
** CID 1585278: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/usr/include/c++/12/bits/stl_algobase.h: 1219 in std::__equal_aux<ceph::buffer::v15_2_0::list::iterator_impl<(bool)1>, ceph::buffer::v15_2_0::list::iterator_impl<(bool)1>>(T1, T1, T2)()
________________________________________________________________________________________________________
*** CID 1585278: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/usr/include/c++/12/bits/stl_algobase.h: 1219 in std::__equal_aux<ceph::buffer::v15_2_0::list::iterator_impl<(bool)1>, ceph::buffer::v15_2_0::list::iterator_impl<(bool)1>>(T1, T1, T2)()
1213 template<typename _II1, typename _II2>
1214 _GLIBCXX20_CONSTEXPR
1215 inline bool
1216 __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
1217 {
1218 return std::__equal_aux1(std::__niter_base(__first1),
>>> CID 1585278: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "__last1" is passed-by-value as parameter to "__niter_base" when it could be moved instead.
1219 std::__niter_base(__last1),
1220 std::__niter_base(__first2));
1221 }
1222
1223 template<typename _II1, typename _Seq1, typename _Cat1, typename _II2>
1224 bool
** CID 1585277: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_rados.cc: 9898 in RGWRados::cls_obj_usage_log_trim(const DoutPrefixProvider *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, unsigned long, unsigned long, optional_yield)()
________________________________________________________________________________________________________
*** CID 1585277: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_rados.cc: 9898 in RGWRados::cls_obj_usage_log_trim(const DoutPrefixProvider *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, unsigned long, unsigned long, optional_yield)()
9892 int RGWRados::cls_obj_usage_log_trim(const DoutPrefixProvider *dpp, const string& oid, const string& user, const string& bucket,
9893 uint64_t start_epoch, uint64_t end_epoch, optional_yield y)
9894 {
9895 rgw_raw_obj obj(svc.zone->get_zone_params().usage_log_pool, oid);
9896
9897 rgw_rados_ref ref;
>>> CID 1585277: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "obj" is passed-by-value as parameter to "get_raw_obj_ref" when it could be moved instead.
9898 int r = get_raw_obj_ref(dpp, obj, &ref);
9899 if (r < 0) {
9900 return r;
9901 }
9902
9903 r = cls_rgw_usage_log_trim_repeat(dpp, ref, user, bucket, start_epoch, end_epoch, y);
** CID 1585276: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/test/librbd/test_internal.cc: 1789 in librbd::TestInternal_SparsifyClone_Test::TestBody()()
________________________________________________________________________________________________________
*** CID 1585276: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/test/librbd/test_internal.cc: 1789 in librbd::TestInternal_SparsifyClone_Test::TestBody()()
1783
1784 bufferptr read_ptr(bl.length());
1785 bufferlist read_bl;
1786 read_bl.push_back(read_ptr);
1787
1788 librbd::io::ReadResult read_result{&read_bl};
>>> CID 1585276: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "read_result" is passed-by-value as parameter to "read" when it could be moved instead.
1789 ASSERT_EQ((ssize_t)read_bl.length(),
1790 api::Io<>::read(*ictx, (1 << ictx->order) * 10, read_bl.length(),
1791 librbd::io::ReadResult{read_result}, 0));
1792 ASSERT_TRUE(bl.contents_equal(read_bl));
1793
1794 std::string oid = ictx->get_object_name(0);
** CID 1585275: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_bucket_sync.cc: 584 in RGWBucketSyncFlowManager::init(const DoutPrefixProvider *, const rgw_sync_policy_info &)::[lambda(const rgw_zone_id &, std::optional<rgw_bucket>, const rgw_zone_id &, std::optional<rgw_bucket>) (instance 1)]::operator ()(const rgw_zone_id &, std::optional<rgw_bucket>, const rgw_zone_id &, std::optional<rgw_bucket>) const()
________________________________________________________________________________________________________
*** CID 1585275: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_bucket_sync.cc: 584 in RGWBucketSyncFlowManager::init(const DoutPrefixProvider *, const rgw_sync_policy_info &)::[lambda(const rgw_zone_id &, std::optional<rgw_bucket>, const rgw_zone_id &, std::optional<rgw_bucket>) (instance 1)]::operator ()(const rgw_zone_id &, std::optional<rgw_bucket>, const rgw_zone_id &, std::optional<rgw_bucket>) const()
578 const rgw_zone_id& dest_zone,
579 std::optional<rgw_bucket> dest_bucket) {
580 if (!parent) {
581 return true;
582 }
583 return parent->allowed_data_flow(source_zone,
>>> CID 1585275: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "source_bucket" is passed-by-value as parameter to "allowed_data_flow" when it could be moved instead.
584 source_bucket,
585 dest_zone,
586 dest_bucket,
587 false); /* just check that it's not disabled */
588 });
589 }
** CID 1585274: (ORDER_REVERSAL)
________________________________________________________________________________________________________
*** CID 1585274: (ORDER_REVERSAL)
/src/static/src/github/ceph/src/client/Client.cc: 12306 in Client::statfs(const char *, statvfs *, const UserPerm &)()
12300 // respect that one instead.
12301 ceph_assert(root != nullptr);
12302 InodeRef quota_root = root->quota.is_enabled(QUOTA_MAX_BYTES) ? root : get_quota_root(root.get(), perms, QUOTA_MAX_BYTES);
12303
12304 // get_quota_root should always give us something if client quotas are
12305 // enabled
>>> CID 1585274: (ORDER_REVERSAL)
>>> Calling "get_val" acquires lock "ceph::common::ConfigProxy.lock" while holding lock "std::unique_lock<std::mutex>._M_device" (count: 2 / 5).
12306 ceph_assert(cct->_conf.get_val<bool>("client_quota") == false || quota_root != nullptr);
12307
12308 /* If bytes quota is set on a directory and conf option "client quota df"
12309 * is also set, available space = quota limit - used space. Else,
12310 * available space = total space - used space. */
12311 if (quota_root && cct->_conf->client_quota_df && quota_root->quota.max_bytes) {
/src/static/src/github/ceph/src/client/Client.cc: 12302 in Client::statfs(const char *, statvfs *, const UserPerm &)()
12296 stbuf->f_namemax = NAME_MAX;
12297
12298 // Usually quota_root will == root_ancestor, but if the mount root has no
12299 // quota but we can see a parent of it that does have a quota, we'll
12300 // respect that one instead.
12301 ceph_assert(root != nullptr);
>>> CID 1585274: (ORDER_REVERSAL)
>>> Calling "get_quota_root" acquires lock "ceph::common::ConfigProxy.lock" while holding lock "std::unique_lock<std::mutex>._M_device" (count: 2 / 5).
12302 InodeRef quota_root = root->quota.is_enabled(QUOTA_MAX_BYTES) ? root : get_quota_root(root.get(), perms, QUOTA_MAX_BYTES);
12303
12304 // get_quota_root should always give us something if client quotas are
12305 // enabled
12306 ceph_assert(cct->_conf.get_val<bool>("client_quota") == false || quota_root != nullptr);
12307
** CID 1585273: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_sync.h: 294 in RGWMetaSyncStatusManager::read_master_log_shards_next(const DoutPrefixProvider *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, std::map<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<int>, std::allocator<std::pair<const int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>, std::map<int, rgw_mdlog_shard_data, std::less<int>, std::allocator<std::pair<const int, rgw_mdlog_shard_data>>>*)()
________________________________________________________________________________________________________
*** CID 1585273: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_sync.h: 294 in RGWMetaSyncStatusManager::read_master_log_shards_next(const DoutPrefixProvider *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, std::map<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<int>, std::allocator<std::pair<const int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>, std::map<int, rgw_mdlog_shard_data, std::less<int>, std::allocator<std::pair<const int, rgw_mdlog_shard_data>>>*)()
288 return master_log.read_log_info(dpp, log_info);
289 }
290 int read_master_log_shards_info(const DoutPrefixProvider *dpp, const std::string& master_period, std::map<int, RGWMetadataLogInfo> *shards_info) {
291 return master_log.read_master_log_shards_info(dpp, master_period, shards_info);
292 }
293 int read_master_log_shards_next(const DoutPrefixProvider *dpp, const std::string& period, std::map<int, std::string> shard_markers, std::map<int, rgw_mdlog_shard_data> *result) {
>>> CID 1585273: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "shard_markers" is passed-by-value as parameter to "read_master_log_shards_next" when it could be moved instead.
294 return master_log.read_master_log_shards_next(dpp, period, shard_markers, result);
295 }
296
297 int run(const DoutPrefixProvider *dpp, optional_yield y) { return master_log.run_sync(dpp, y); }
298
299
** CID 1585272: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_sal_rados.cc: 536 in rgw::sal::RadosBucket::read_stats_async(const DoutPrefixProvider *, const rgw::bucket_index_layout_generation &, int, boost::intrusive_ptr<rgw::sal::ReadStatsCB>)()
________________________________________________________________________________________________________
*** CID 1585272: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_sal_rados.cc: 536 in rgw::sal::RadosBucket::read_stats_async(const DoutPrefixProvider *, const rgw::bucket_index_layout_generation &, int, boost::intrusive_ptr<rgw::sal::ReadStatsCB>)()
530 }
531
532 int RadosBucket::read_stats_async(const DoutPrefixProvider *dpp,
533 const bucket_index_layout_generation& idx_layout,
534 int shard_id, boost::intrusive_ptr<ReadStatsCB> ctx)
535 {
>>> CID 1585272: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "ctx" is passed-by-value as parameter to "get_bucket_stats_async" when it could be moved instead.
536 return store->getRados()->get_bucket_stats_async(dpp, get_info(), idx_layout, shard_id, ctx);
537 }
538
539 int RadosBucket::sync_user_stats(const DoutPrefixProvider *dpp, optional_yield y,
540 RGWBucketEnt* ent)
541 {
** CID 1585271: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/tools/rbd/MirrorDaemonServiceInfo.cc: 104 in rbd::MirrorDaemonServiceInfo::get_mirror_service_dump()()
________________________________________________________________________________________________________
*** CID 1585271: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/tools/rbd/MirrorDaemonServiceInfo.cc: 104 in rbd::MirrorDaemonServiceInfo::get_mirror_service_dump()()
98 int MirrorDaemonServiceInfo::get_mirror_service_dump() {
99 librados::Rados rados(m_io_ctx);
100 std::string cmd = R"({"prefix": "service dump", "format": "json"})";
101 bufferlist in_bl;
102 bufferlist out_bl;
103
>>> CID 1585271: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "cmd" is passed-by-value as parameter to "mon_command" when it could be moved instead.
104 int r = rados.mon_command(cmd, in_bl, &out_bl, nullptr);
105 if (r < 0) {
106 std::cerr << "rbd: failed to query services: " << cpp_strerror(r)
107 << std::endl;
108 return r;
109 }
** CID 1585270: Uninitialized variables (USE_AFTER_MOVE)
/src/static/src/github/ceph/src/include/neorados/RADOS.hpp: 1697 in neorados::RADOS::enumerate_objects<boost::asio::redirect_error_t<boost::asio::use_awaitable_t<boost::asio::any_io_executor>>>(neorados::IOContext, neorados::Cursor, neorados::Cursor, unsigned int, ceph::buffer::v15_2_0::list, T1 &&)()
________________________________________________________________________________________________________
*** CID 1585270: Uninitialized variables (USE_AFTER_MOVE)
/src/static/src/github/ceph/src/include/neorados/RADOS.hpp: 1697 in neorados::RADOS::enumerate_objects<boost::asio::redirect_error_t<boost::asio::use_awaitable_t<boost::asio::any_io_executor>>>(neorados::IOContext, neorados::Cursor, neorados::Cursor, unsigned int, ceph::buffer::v15_2_0::list, T1 &&)()
1691 using EnumerateComp = boost::asio::any_completion_handler<EnumerateSig>;
1692 template<boost::asio::completion_token_for<EnumerateSig> CompletionToken>
1693 auto enumerate_objects(IOContext ioc, Cursor begin,
1694 Cursor end, std::uint32_t max,
1695 ceph::buffer::list filter,
1696 CompletionToken&& token) {
>>> CID 1585270: Uninitialized variables (USE_AFTER_MOVE)
>>> "token" is used after it has been already moved.
1697 auto consigned = boost::asio::consign(
1698 std::forward<CompletionToken>(token), boost::asio::make_work_guard(
1699 boost::asio::get_associated_executor(token, get_executor())));
1700 return boost::asio::async_initiate<decltype(consigned), EnumerateSig>(
1701 [ioc = std::move(ioc), begin = std::move(begin), end = std::move(end),
1702 max, filter = std::move(filter), this](auto&& handler) mutable {
** CID 1585269: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/tools/rbd/action/Perf.cc: 125 in rbd::action::perf::<unnamed>::query_iostats(librados::v14_2_0::Rados &, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, rbd::action::perf::<unnamed>::StatDescriptor, std::vector<rbd::action::perf::<unnamed>::ImageStat, std::allocator<rbd::action::perf::<unnamed>::ImageStat>> *, std::basic_ostream<char, std::char_traits<char>>&)()
________________________________________________________________________________________________________
*** CID 1585269: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/tools/rbd/action/Perf.cc: 125 in rbd::action::perf::<unnamed>::query_iostats(librados::v14_2_0::Rados &, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, rbd::action::perf::<unnamed>::StatDescriptor, std::vector<rbd::action::perf::<unnamed>::ImageStat, std::allocator<rbd::action::perf::<unnamed>::ImageStat>> *, std::basic_ostream<char, std::char_traits<char>>&)()
119 "format": "json"
120 }")";
121
122 bufferlist in_bl;
123 bufferlist out_bl;
124 std::string outs;
>>> CID 1585269: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "cmd" is passed-by-value as parameter to "mgr_command" when it could be moved instead.
125 int r = rados.mgr_command(cmd, in_bl, &out_bl, &outs);
126 if (r == -EOPNOTSUPP) {
127 err_os << "rbd: 'rbd_support' mgr module is not enabled."
128 << std::endl << std::endl
129 << "Use 'ceph mgr module enable rbd_support' to enable."
130 << std::endl;
** CID 1585268: Error handling issues (UNCAUGHT_EXCEPT)
/src/static/src/github/ceph/src/osd/scrubber/scrub_machine.h: 195 in Scrub::IntervalChanged::~IntervalChanged()()
________________________________________________________________________________________________________
*** CID 1585268: Error handling issues (UNCAUGHT_EXCEPT)
/src/static/src/github/ceph/src/osd/scrubber/scrub_machine.h: 195 in Scrub::IntervalChanged::~IntervalChanged()()
189 * This event is distinct from FullReset because replicas are always responsible
190 * for releasing any interval specific state (including but certainly not limited to
191 * scrub reservations) upon interval change, without coordination from the
192 * Primary. This event notifies the ScrubMachine that it can forget about
193 * such remote state.
194 */
>>> CID 1585268: Error handling issues (UNCAUGHT_EXCEPT)
>>> An exception of type "boost::container::length_error_t" is thrown but the exception specification "/*implicit*/noexcept" doesn't allow it to be thrown. This will result in a call to terminate().
195 MEV(IntervalChanged)
196
197 /**
198 * stops the scrubbing session, and resets the scrubber.
199 * For a replica - aborts the handling of the current request.
200 * In both cases - a transition to the peering mode quiescent state (i.e.
** CID 1585267: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/osd/scrubber/scrub_machine.cc: 180 in Scrub::Session::Session(boost::statechart::state<Scrub::Session, Scrub::PrimaryActive, Scrub::ReservingReplicas, (boost::statechart::history_mode)0>::my_context)()
________________________________________________________________________________________________________
*** CID 1585267: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/osd/scrubber/scrub_machine.cc: 180 in Scrub::Session::Session(boost::statechart::state<Scrub::Session, Scrub::PrimaryActive, Scrub::ReservingReplicas, (boost::statechart::history_mode)0>::my_context)()
174 scrbr->clear_pgscrub_state();
175 }
176
177 // ----------------------- Session -----------------------------------------
178
179 Session::Session(my_context ctx)
>>> CID 1585267: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "ctx" is passed-by-value as parameter to "boost::statechart::state<Scrub::Session, Scrub::PrimaryActive, Scrub::ReservingReplicas, (boost::statechart::history_mode)0>::state(boost::statechart::state<Scrub::Session, Scrub::PrimaryActive, Scrub::ReservingReplicas, (boost::statechart::history_mode)0>::my_context)" when it could be moved instead.
180 : my_base(ctx)
181 , NamedSimply(context<ScrubMachine>().m_scrbr, "PrimaryActive/Session")
182 {
183 dout(10) << "-- state -->> PrimaryActive/Session" << dendl;
184 DECLARE_LOCALS; // 'scrbr' & 'pg_id' aliases
185
** CID 1585266: Memory - illegal accesses (WRAPPER_ESCAPE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_gc.cc: 231 in RGWGC::remove(int, const std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> &, librados::v14_2_0::AioCompletion **, optional_yield)()
________________________________________________________________________________________________________
*** CID 1585266: Memory - illegal accesses (WRAPPER_ESCAPE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_gc.cc: 231 in RGWGC::remove(int, const std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> &, librados::v14_2_0::AioCompletion **, optional_yield)()
225 ObjectWriteOperation op;
226 cls_rgw_gc_remove(op, tags);
227
228 aio_completion_ptr c{librados::Rados::aio_create_completion(nullptr, nullptr)};
229 int ret = store->gc_aio_operate(obj_names[index], c.get(), &op);
230 if (ret >= 0) {
>>> CID 1585266: Memory - illegal accesses (WRAPPER_ESCAPE)
>>> The internal representation of local "c" escapes into "*pc", but is destroyed when it exits scope.
231 *pc = c.get();
232 c.release();
233 }
234 return ret;
235 }
236
** CID 1585265: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_data_sync.cc: 1940 in RGWDataIncSyncShardCR::RGWDataIncSyncShardCR(RGWDataSyncCtx *, const rgw_pool &, unsigned int, rgw_data_sync_marker &, std::shared_ptr<RGWSyncTraceNode>, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, const rgw_raw_obj &, boost::intrusive_ptr<const RGWContinuousLeaseCR>, const rgw_data_sync_status &, RGWObjVersionTracker &, const boost::intrusive_ptr<rgw::bucket_sync::Cache> &, std::mutex &, boost::container::flat_set<rgw_data_notify_entry, std::less<rgw_data_notify_entry>, void> &)()
________________________________________________________________________________________________________
*** CID 1585265: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/rados/rgw_data_sync.cc: 1940 in RGWDataIncSyncShardCR::RGWDataIncSyncShardCR(RGWDataSyncCtx *, const rgw_pool &, unsigned int, rgw_data_sync_marker &, std::shared_ptr<RGWSyncTraceNode>, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, const rgw_raw_obj &, boost::intrusive_ptr<const RGWContinuousLeaseCR>, const rgw_data_sync_status &, RGWObjVersionTracker &, const boost::intrusive_ptr<rgw::bucket_sync::Cache> &, std::mutex &, boost::container::flat_set<rgw_data_notify_entry, std::less<rgw_data_notify_entry>, void> &)()
1934 const string& status_oid, const rgw_raw_obj& error_repo,
1935 boost::intrusive_ptr<const RGWContinuousLeaseCR> lease_cr,
1936 const rgw_data_sync_status& sync_status, RGWObjVersionTracker& objv,
1937 const boost::intrusive_ptr<rgw::bucket_sync::Cache>& bucket_shard_cache,
1938 ceph::mutex& inc_lock,
1939 bc::flat_set<rgw_data_notify_entry>& modified_shards)
>>> CID 1585265: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "tn" is passed-by-value as parameter to "RGWDataBaseSyncShardCR::RGWDataBaseSyncShardCR(RGWDataSyncCtx *, rgw_pool const &, uint32_t, rgw_data_sync_marker &, RGWSyncTraceNodeRef, std::string const &, rgw_raw_obj const &, boost::intrusive_ptr<RGWContinuousLeaseCR const>, rgw_data_sync_status const &, RGWObjVersionTracker &, boost::intrusive_ptr<rgw::bucket_sync::Cache> const &)" when it could be moved instead.
1940 : RGWDataBaseSyncShardCR(sc, pool, shard_id, sync_marker, tn,
1941 status_oid, error_repo, std::move(lease_cr),
1942 sync_status, objv, bucket_shard_cache),
1943 inc_lock(inc_lock), modified_shards(modified_shards) {}
1944
1945 int operate(const DoutPrefixProvider *dpp) override {
** CID 1585264: Uninitialized variables (MISSING_RETURN)
/src/static/src/github/ceph/src/test/neorados/read_operations.cc: 268 in NeoRadosReadOps_Checksum_Test::CoTestBody()()
________________________________________________________________________________________________________
*** CID 1585264: Uninitialized variables (MISSING_RETURN)
/src/static/src/github/ceph/src/test/neorados/read_operations.cc: 268 in NeoRadosReadOps_Checksum_Test::CoTestBody()()
262 co_await execute(oid, ReadOp{}.checksum(hash_alg::crc32c, seed, 0,
263 data.length(), 4, &crc));
264 EXPECT_EQ(crc32c(seed, data.substr(0, 4)), crc[0]);
265 EXPECT_EQ(crc32c(seed, data.substr(4, 4)), crc[1]);
266 }
267
>>> CID 1585264: Uninitialized variables (MISSING_RETURN)
>>> Arriving at the end of a function without returning a value.
268 co_return;
269 }
270
271 CORO_TEST_F(NeoRadosReadOps, RWOrderedRead, ReadOpTest) {
272 buffer::list bl;
273 sys::error_code ec;
** CID 1585263: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/boost/include/boost/json/impl/parser.ipp: 56 in boost::json::parser::reset(boost::json::storage_ptr)()
________________________________________________________________________________________________________
*** CID 1585263: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/boost/include/boost/json/impl/parser.ipp: 56 in boost::json::parser::reset(boost::json::storage_ptr)()
50
51 void
52 parser::
53 reset(storage_ptr sp) noexcept
54 {
55 p_.reset();
>>> CID 1585263: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "sp" is passed-by-value as parameter to "reset" when it could be moved instead.
56 p_.handler().st.reset(sp);
57 }
58
59 std::size_t
60 parser::
61 write_some(
** CID 1585262: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/boost/include/boost/intrusive/hashtable.hpp: 1172 in boost::intrusive::bucket_plus_vtraits<boost::intrusive::bhtraits<LRUSet<LogEntryKey, (int)128>::Node, boost::intrusive::slist_node_traits<void *>, (boost::intrusive::link_mode_type)1, boost::intrusive::dft_tag, (unsigned int)4>, boost::intrusive::bucket_traits_impl<boost::intrusive::bucket_impl<boost::intrusive::slist_node_traits<void *>> *, unsigned long>, (bool)0>::priv_erase_from_single_bucket<boost::intrusive::node_cast_adaptor<boost::intrusive::detail::node_disposer<boost::intrusive::detail::null_disposer, boost::intrusive::bhtraits<LRUSet<LogEntryKey, (int)128>::Node, boost::intrusive::slist_node_traits<void *>, (boost::intrusive::link_mode_type)1, boost::intrusive::dft_tag, (unsigned int)4>, (boost::intrusive::algo_types)3>, boost::intrusive::slist_node<void *> *, boost::intrusive::slist_node<void *> *>>(boost::intrusive::bucket_impl<boost::intrusive::slist_node_traits<void *>> &, boost::intrusive::slist_iterator<boost::intrusive::trivial_value_traits<boost::intrusive::slist_node_traits<void *>, (boost::intrusive::link_mode_type)0>, (bool)0>, boost::intrusive::slist_iterator<boost::intrusive::trivial_value_traits<boost::intrusive::slist_node_traits<void *>, (boost::intrusive::link_mode_type)0>, (bool)0>, T1, boost::move_detail::bool_<(bool)0>)()
________________________________________________________________________________________________________
*** CID 1585262: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/boost/include/boost/intrusive/hashtable.hpp: 1172 in boost::intrusive::bucket_plus_vtraits<boost::intrusive::bhtraits<LRUSet<LogEntryKey, (int)128>::Node, boost::intrusive::slist_node_traits<void *>, (boost::intrusive::link_mode_type)1, boost::intrusive::dft_tag, (unsigned int)4>, boost::intrusive::bucket_traits_impl<boost::intrusive::bucket_impl<boost::intrusive::slist_node_traits<void *>> *, unsigned long>, (bool)0>::priv_erase_from_single_bucket<boost::intrusive::node_cast_adaptor<boost::intrusive::detail::node_disposer<boost::intrusive::detail::null_disposer, boost::intrusive::bhtraits<LRUSet<LogEntryKey, (int)128>::Node, boost::intrusive::slist_node_traits<void *>, (boost::intrusive::link_mode_type)1, boost::intrusive::dft_tag, (unsigned int)4>, (boost::intrusive::algo_types)3>, boost::intrusive::slist_node<void *> *, boost::intrusive::slist_node<void *> *>>(boost::intrusive::bucket_impl<boost::intrusive::slist_node_traits<void *>> &, boost::intrusive::slist_iterator<boost::intrusive::trivial_value_traits<boost::intrusive::slist_node_traits<void *>, (boost::intrusive::link_mode_type)0>, (bool)0>, boost::intrusive::slist_iterator<boost::intrusive::trivial_value_traits<boost::intrusive::slist_node_traits<void *>, (boost::intrusive::link_mode_type)0>, (bool)0>, T1, boost::move_detail::bool_<(bool)0>)()
1166 }
1167
1168 template<class NodeDisposer>
1169 static std::size_t priv_erase_from_single_bucket
1170 (bucket_type &, siterator sbefore_first, siterator slast, NodeDisposer node_disposer, detail::false_) //optimize multikey
1171 {
>>> CID 1585262: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "node_disposer" is passed-by-value as parameter to "unlink_after_and_dispose" when it could be moved instead.
1172 return slist_node_algorithms::unlink_after_and_dispose(sbefore_first.pointed_node(), slast.pointed_node(), node_disposer);
1173 }
1174
1175 template<class NodeDisposer>
1176 static void priv_erase_node(bucket_type &b, siterator i, NodeDisposer node_disposer, detail::true_) //optimize multikey
1177 {
** CID 1585261: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/rgw_sal_filter.cc: 722 in rgw::sal::FilterBucket::get_multipart_upload(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, ACLOwner, std::chrono::time_point<ceph::real_clock, std::chrono::duration<unsigned long, std::ratio<(long)1, (long)1000000000>>>)()
________________________________________________________________________________________________________
*** CID 1585261: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/rgw_sal_filter.cc: 722 in rgw::sal::FilterBucket::get_multipart_upload(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, ACLOwner, std::chrono::time_point<ceph::real_clock, std::chrono::duration<unsigned long, std::ratio<(long)1, (long)1000000000>>>)()
716 std::unique_ptr<MultipartUpload> FilterBucket::get_multipart_upload(
717 const std::string& oid,
718 std::optional<std::string> upload_id,
719 ACLOwner owner, ceph::real_time mtime)
720 {
721 std::unique_ptr<MultipartUpload> nmu =
>>> CID 1585261: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "upload_id" is passed-by-value as parameter to "get_multipart_upload" when it could be moved instead.
722 next->get_multipart_upload(oid, upload_id, owner, mtime);
723
724 return std::make_unique<FilterMultipartUpload>(std::move(nmu), this);
725 }
726
727 int FilterBucket::list_multiparts(const DoutPrefixProvider *dpp,
** CID 1585260: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/dbstore/sqlite/sqliteDB.h: 355 in SQLPutObjectData::SQLPutObjectData(sqlite3 **, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ceph::common::CephContext *)()
________________________________________________________________________________________________________
*** CID 1585260: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/src/static/src/github/ceph/src/rgw/driver/dbstore/sqlite/sqliteDB.h: 355 in SQLPutObjectData::SQLPutObjectData(sqlite3 **, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ceph::common::CephContext *)()
349 private:
350 sqlite3 **sdb = NULL;
351 sqlite3_stmt *stmt = NULL; // Prepared statement
352
353 public:
354 SQLPutObjectData(void **db, std::string db_name, CephContext *cct) : SQLiteDB((sqlite3 *)(*db), db_name, cct), sdb((sqlite3 **)db) {}
>>> CID 1585260: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "db_name" is passed-by-value as parameter to "SQLiteDB::SQLiteDB(sqlite3 *, std::string, ceph::common::CephContext *)" when it could be moved instead.
355 SQLPutObjectData(sqlite3 **sdbi, std::string db_name, CephContext *cct) : SQLiteDB(*sdbi, db_name, cct), sdb(sdbi) {}
356
357 ~SQLPutObjectData() {
358 if (stmt)
359 sqlite3_finalize(stmt);
360 }
** CID 1585259: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/usr/include/c++/12/bits/stl_algobase.h: 1555 in std::equal<ceph::buffer::v15_2_0::list::iterator_impl<(bool)1>, ceph::buffer::v15_2_0::list::iterator_impl<(bool)1>>(T1, T1, T2)()
________________________________________________________________________________________________________
*** CID 1585259: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/usr/include/c++/12/bits/stl_algobase.h: 1555 in std::equal<ceph::buffer::v15_2_0::list::iterator_impl<(bool)1>, ceph::buffer::v15_2_0::list::iterator_impl<(bool)1>>(T1, T1, T2)()
1549 __glibcxx_function_requires(_InputIteratorConcept<_II2>)
1550 __glibcxx_function_requires(_EqualOpConcept<
1551 typename iterator_traits<_II1>::value_type,
1552 typename iterator_traits<_II2>::value_type>)
1553 __glibcxx_requires_can_increment_range(__first1, __last1, __first2);
1554
>>> CID 1585259: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "__last1" is passed-by-value as parameter to "__equal_aux" when it could be moved instead.
1555 return std::__equal_aux(__first1, __last1, __first2);
1556 }
1557
1558 /**
1559 * @brief Tests a range for element-wise equality.
1560 * @ingroup non_mutating_algorithms
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yojIR8ODHcGVd1JcCGjvdH5y4fWRBfYFtGznfDs0k2eCA-3D-3DwXLd_i4Flcm-2Bwkv4yu8VTJlSpclOEUldwlBTRexkpNehVmCswBDxYHWvAvFR4G-2BnsaGOAHefYJdUFzdPi9gxpRbjfRrvo07CHZxnrRwuF6BcQVYlSH-2B5xmhZnu5faRIfgRzHuZa4hUp98n8-2BO21Z7NNF2g2zeierEAnT7508w4jgbtGN45vBeyi3EnwHysVqpAakZEZTiE9gn-2B2u4Vic2fRUWFw-3D-3D
To manage Coverity Scan email notifications for "kkeithle@xxxxxxxxxx", click https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxDHW6UeXhaB-2B5HlPeVFALF1pRpqSsV9NFEgPabv4pOFuwkQ07-2BD98liqlVKscQM3P7f0kYLqxtiaj4DkZKZfT8dstcfxK1l0FHsoLd2Zo1to-3D3lzY_i4Flcm-2Bwkv4yu8VTJlSpclOEUldwlBTRexkpNehVmCswBDxYHWvAvFR4G-2BnsaGOAFR0X3Vqndu8ohcDL-2B-2FB8Nfu5WPBFYgkrIS15twH2e3-2F3OPLHzqYJhfTZzwVXdTwd7CD6Z99e3U7UxX8YeaBStT80aJeQwPcYjAQLsElpxLeO-2B15ufEA1smcEjWDpOuqYIRO8CynUhfT6j6k1yFLnpQ-3D-3D
Kaleb
_______________________________________________ Dev mailing list -- dev@xxxxxxx To unsubscribe send an email to dev-leave@xxxxxxx