mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
Merge pull request #52044 from vedanshbhartia/coverity_fix_tags
rgw: user correct tags for coverity annotations and add the SUPPRESS keyword
This commit is contained in:
commit
227ea203b0
@ -314,7 +314,7 @@ public:
|
||||
&cb);
|
||||
auto c = p->_cur;
|
||||
p.release();
|
||||
// coverity[RESOURCE_LEAK:FALSE]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
return c;
|
||||
}
|
||||
static void complete(Ptr&& p, int r) {
|
||||
|
@ -214,7 +214,7 @@ int RGWGC::async_defer_chain(const string& tag, const cls_rgw_obj_chain& chain)
|
||||
|
||||
int ret = store->gc_aio_operate(obj_names[i], state->completion, &op);
|
||||
if (ret == 0) {
|
||||
// coverity[RESOURCE_LEAK:FALSE]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
state.release(); // release ownership until async_defer_callback()
|
||||
}
|
||||
return ret;
|
||||
|
@ -225,7 +225,7 @@ int DataLogTrimPollCR::operate(const DoutPrefixProvider *dpp)
|
||||
set_status("acquiring trim lock");
|
||||
|
||||
// interval is a small number and unlikely to overflow
|
||||
// coverity[Y2K38_SAFETY:FALSE]
|
||||
// coverity[store_truncates_time_t:SUPPRESS]
|
||||
yield call(new RGWSimpleRadosLockCR(store->svc()->rados->get_async_processor(), store,
|
||||
rgw_raw_obj(store->svc()->zone->get_zone_params().log_pool, lock_oid),
|
||||
"data_trim", lock_cookie,
|
||||
|
@ -670,7 +670,7 @@ int MetaTrimPollCR::operate(const DoutPrefixProvider *dpp)
|
||||
set_status("acquiring trim lock");
|
||||
|
||||
// interval is a small number and unlikely to overflow
|
||||
// coverity[Y2K38_SAFETY:FALSE]
|
||||
// coverity[store_truncates_time_t:SUPPRESS]
|
||||
yield call(new RGWSimpleRadosLockCR(store->svc()->rados->get_async_processor(), store,
|
||||
obj, name, cookie, interval.sec()));
|
||||
if (retcode < 0) {
|
||||
|
@ -3023,7 +3023,7 @@ static int scan_totp(CephContext *cct, ceph::real_time& now, rados::cls::otp::ot
|
||||
if (rc != OATH_INVALID_OTP) {
|
||||
// oath_totp_validate2 is an external library function, cannot fix internally
|
||||
// Further, step_size is a small number and unlikely to overflow
|
||||
// coverity[Y2K38_SAFETY:FALSE]
|
||||
// coverity[store_truncates_time_t:SUPPRESS]
|
||||
rc = oath_totp_validate2(totp.seed_bin.c_str(), totp.seed_bin.length(),
|
||||
start_time,
|
||||
step_size,
|
||||
@ -10368,7 +10368,7 @@ next:
|
||||
}
|
||||
|
||||
// time offset is a small number and unlikely to overflow
|
||||
// coverity[Y2K38_SAFETY:FALSE]
|
||||
// coverity[store_truncates_time_t:SUPPRESS]
|
||||
config.time_ofs = time_ofs;
|
||||
|
||||
/* now update the backend */
|
||||
|
@ -57,7 +57,7 @@ AioResultList BlockingAioThrottle::get(rgw_raw_obj obj,
|
||||
std::move(f)(this, *static_cast<AioResult*>(p.get()));
|
||||
lock.lock();
|
||||
}
|
||||
// coverity[RESOURCE_LEAK:FALSE]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
p.release();
|
||||
return std::move(completed);
|
||||
}
|
||||
@ -147,7 +147,7 @@ AioResultList YieldingAioThrottle::get(rgw_raw_obj obj,
|
||||
pending.push_back(*p);
|
||||
std::move(f)(this, *static_cast<AioResult*>(p.get()));
|
||||
}
|
||||
// coverity[RESOURCE_LEAK:FALSE]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
p.release();
|
||||
return std::move(completed);
|
||||
}
|
||||
|
@ -1294,7 +1294,7 @@ struct RGWBucketEnt {
|
||||
ENCODE_START(7, 5, bl);
|
||||
uint64_t s = size;
|
||||
// issue tracked here: https://tracker.ceph.com/issues/61160
|
||||
// coverity[Y2K38_SAFETY]
|
||||
// coverity[store_truncates_time_t:SUPPRESS]
|
||||
__u32 mt = ceph::real_clock::to_time_t(creation_time);
|
||||
std::string empty_str; // originally had the bucket name here, but we encode bucket later
|
||||
encode(empty_str, bl);
|
||||
|
@ -114,7 +114,7 @@ struct D3nL1CacheRequest {
|
||||
auto ec = boost::system::error_code{-ret, boost::system::system_category()};
|
||||
ceph::async::post(std::move(p), ec, bufferlist{});
|
||||
} else {
|
||||
// coverity[RESOURCE_LEAK:FALSE]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
(void)p.release();
|
||||
}
|
||||
return init.result.get();
|
||||
|
@ -429,7 +429,7 @@ private:
|
||||
} else {
|
||||
ldout(conn->cct, 20) << "Kafka publish (no callback): OK" << dendl;
|
||||
}
|
||||
// coverity[RESOURCE_LEAK:FALSE]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
}
|
||||
|
||||
// the managers thread:
|
||||
|
@ -419,7 +419,7 @@ RGWKMIPManagerImpl::add_request(RGWKMIPTransceiver *req)
|
||||
if (going_down)
|
||||
return -ECANCELED;
|
||||
// requests is a boost::intrusive::list, which manages pointers and does not copy the instance
|
||||
// coverity[RESOURCE_LEAK:FALSE]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
requests.push_back(*new Request{*req});
|
||||
l.unlock();
|
||||
if (worker)
|
||||
|
@ -133,7 +133,7 @@ RGWPeriodHistory::Impl::Impl(CephContext* cct, Puller* puller,
|
||||
history->periods.push_back(current_period);
|
||||
|
||||
// insert as our current history
|
||||
// coverity[RESOURCE_LEAK:FALSE]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
current_history = histories.insert(*history).first;
|
||||
|
||||
// get a cursor to the current period
|
||||
@ -246,7 +246,7 @@ Cursor RGWPeriodHistory::Impl::insert_locked(RGWPeriod&& period)
|
||||
// create a new history for this period
|
||||
auto history = new History;
|
||||
history->periods.emplace_back(std::move(period));
|
||||
// coverity[RESOURCE_LEAK:FALSE]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
histories.insert(last, *history);
|
||||
|
||||
i = Set::s_iterator_to(*history);
|
||||
@ -296,7 +296,7 @@ Cursor RGWPeriodHistory::Impl::insert_locked(RGWPeriod&& period)
|
||||
// create a new history for this period
|
||||
auto history = new History;
|
||||
history->periods.emplace_back(std::move(period));
|
||||
// coverity[RESOURCE_LEAK:FALSE]
|
||||
// coverity[leaked_storage:SUPPRESS]
|
||||
histories.insert(i, *history);
|
||||
|
||||
i = Set::s_iterator_to(*history);
|
||||
|
@ -170,7 +170,7 @@ bufferlist RGWPutObj_Torrent::bencode_torrent(std::string_view filename) const
|
||||
// Only encode create_date and sha1 info. Other fields will be added during
|
||||
// GetObjectTorrent by rgw_read_torrent_file()
|
||||
// issue tracked here: https://tracker.ceph.com/issues/61160
|
||||
// coverity[Y2K38_SAFETY]
|
||||
// coverity[store_truncates_time_t:SUPPRESS]
|
||||
bencode(CREATION_DATE, std::time(nullptr), bl);
|
||||
|
||||
bencode_key(INFO_PIECES, bl);
|
||||
|
Loading…
Reference in New Issue
Block a user