These Coverity function annotations were added
around 10 years ago. Since then, Coverity seems
to produce less false positives. Out of about 20
annotations, only 3 warnings get surpressed.
Thus, the applicability of these annotations
should be re-evaluated.
Coverity has more advanced tools now for reducing
false positives. Various Lustre functions and
macros could be modeled rather than using
function annotations. But first, we need to get
a good idea of what kinds of false postives are
being generated.
https://scan.coverity.com/tune
Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ibcb9cf55574675e20b13a4f7a1b9142a3b75e262
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51793
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
12 files changed:
}
EXPORT_SYMBOL(libcfs_debug_dumplog);
}
EXPORT_SYMBOL(libcfs_debug_dumplog);
void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
{
libcfs_catastrophe = 1;
void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
{
libcfs_catastrophe = 1;
* in exp_lock_hash. */
/* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp() */
* in exp_lock_hash. */
/* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp() */
- /* coverity[overrun-buffer-val] */
cfs_hash_del(lock->l_export->exp_lock_hash,
&lock->l_remote_handle, &lock->l_exp_hash);
}
cfs_hash_del(lock->l_export->exp_lock_hash,
&lock->l_remote_handle, &lock->l_exp_hash);
}
* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
- /* coverity[overrun-buffer-val] */
lock = cfs_hash_lookup(req->rq_export->exp_lock_hash,
(void *)&dlm_req->lock_handle[0]);
if (lock != NULL) {
lock = cfs_hash_lookup(req->rq_export->exp_lock_hash,
(void *)&dlm_req->lock_handle[0]);
if (lock != NULL) {
* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
- /* coverity[overrun-buffer-val] */
cfs_hash_del(lock->l_export->exp_lock_hash,
&lock->l_remote_handle, &lock->l_exp_hash);
}
cfs_hash_del(lock->l_export->exp_lock_hash,
&lock->l_remote_handle, &lock->l_exp_hash);
}
* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
- /* coverity[overrun-buffer-val] */
cfs_hash_rehash_key(exp->exp_lock_hash,
&lock->l_remote_handle,
&reply->lock_handle,
cfs_hash_rehash_key(exp->exp_lock_hash,
&lock->l_remote_handle,
&reply->lock_handle,
* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
* In the function below, .hs_keycmp resolves to
* ldlm_export_lock_keycmp()
*/
- /* coverity[overrun-buffer-val] */
cfs_hash_rehash_key(exp->exp_lock_hash,
&lock->l_remote_handle,
&reply->lock_handle,
cfs_hash_rehash_key(exp->exp_lock_hash,
&lock->l_remote_handle,
&reply->lock_handle,
/* In the function below, .hs_keycmp resolves to
* u_obj_hop_keycmp() */
/* In the function below, .hs_keycmp resolves to
* u_obj_hop_keycmp() */
- /* coverity[overrun-buffer-val] */
o = lu_object_find_at(env, nd, &info->lti_fid, NULL);
if (IS_ERR(o))
GOTO(out, rc = PTR_ERR(o));
o = lu_object_find_at(env, nd, &info->lti_fid, NULL);
if (IS_ERR(o))
GOTO(out, rc = PTR_ERR(o));
lum3 = buf->lb_buf;
/* In the function below, .hs_keycmp resolves to
* pool_hashkey_keycmp() */
lum3 = buf->lb_buf;
/* In the function below, .hs_keycmp resolves to
* pool_hashkey_keycmp() */
- /* coverity[overrun-buffer-val] */
pool = lod_find_pool(d, lum3->lmm_pool_name);
if (pool == NULL)
goto out;
pool = lod_find_pool(d, lum3->lmm_pool_name);
if (pool == NULL)
goto out;
CDEBUG(D_INFO, "delete pool %p\n", pool);
/* In the function below, .hs_keycmp resolves to
* pool_hashkey_keycmp() */
CDEBUG(D_INFO, "delete pool %p\n", pool);
/* In the function below, .hs_keycmp resolves to
* pool_hashkey_keycmp() */
- /* coverity[overrun-buffer-val] */
lod_pool_del(obd, pool->pool_name);
}
lod_pool_del(obd, pool->pool_name);
}
/* In the function below, .hs_keycmp resolves to
* pool_hashkey_keycmp() */
/* In the function below, .hs_keycmp resolves to
* pool_hashkey_keycmp() */
- /* coverity[overrun-buffer-val] */
if (pool_name)
pool = lod_find_pool(d, pool_name);
if (pool_name)
pool = lod_find_pool(d, pool_name);
CDEBUG(D_INFO, "delete pool %p\n", pool);
/* In the function below, .hs_keycmp resolves to
* pool_hashkey_keycmp() */
CDEBUG(D_INFO, "delete pool %p\n", pool);
/* In the function below, .hs_keycmp resolves to
* pool_hashkey_keycmp() */
- /* coverity[overrun-buffer-val] */
lov_pool_del(obd, pool->pool_name);
}
lov_pool_hash_destroy(&lov->lov_pools_hash_body);
lov_pool_del(obd, pool->pool_name);
}
lov_pool_hash_destroy(&lov->lov_pools_hash_body);
LASSERTF(subdev != NULL, "not init ost %d\n", ost_idx);
/* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp() */
LASSERTF(subdev != NULL, "not init ost %d\n", ost_idx);
/* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp() */
- /* coverity[overrun-buffer-val] */
stripe = lov_sub_find(env, subdev, ofid, subconf);
if (IS_ERR(stripe))
GOTO(out, result = PTR_ERR(stripe));
stripe = lov_sub_find(env, subdev, ofid, subconf);
if (IS_ERR(stripe))
GOTO(out, result = PTR_ERR(stripe));
PFID(child_fid));
/* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp() */
PFID(child_fid));
/* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp() */
- /* coverity[overrun-buffer-val] */
child = mdt_object_new(info->mti_env, mdt, child_fid);
} else {
/*
child = mdt_object_new(info->mti_env, mdt, child_fid);
} else {
/*
* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp()
*/
* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp()
*/
- /* coverity[overrun-buffer-val] */
obj = cl_object_find(env, echo_dev2cl(d), fid, &conf->eoc_cl);
if (IS_ERR(obj))
GOTO(out, eco = (void *)obj);
obj = cl_object_find(env, echo_dev2cl(d), fid, &conf->eoc_cl);
if (IS_ERR(obj))
GOTO(out, eco = (void *)obj);
* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp()
*/
* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp()
*/
- /* coverity[overrun-buffer-val] */
child = lu_object_find_at(env, &ed->ed_cl.cd_lu_dev, fid, NULL);
RETURN(child);
child = lu_object_find_at(env, &ed->ed_cl.cd_lu_dev, fid, NULL);
RETURN(child);
* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp()
*/
* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp()
*/
- /* coverity[overrun-buffer-val] */
parent = lu_object_find_at(env, &ed->ed_cl.cd_lu_dev, fid, NULL);
if (IS_ERR(parent)) {
CERROR("Can not find the parent "DFID": rc = %ld\n",
parent = lu_object_find_at(env, &ed->ed_cl.cd_lu_dev, fid, NULL);
if (IS_ERR(parent)) {
CERROR("Can not find the parent "DFID": rc = %ld\n",
* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp()
*/
* In the function below, .hs_keycmp resolves to
* lu_obj_hop_keycmp()
*/
- /* coverity[overrun-buffer-val] */
rc = echo_create_md_object(env, ed, parent, fid, name, namelen,
id, mode, count, stripe_count,
stripe_index);
rc = echo_create_md_object(env, ed, parent, fid, name, namelen,
id, mode, count, stripe_count,
stripe_index);
* ptlrpc_uuid_to_peer() initializes its 2nd parameter
* before accessing its values.
*/
* ptlrpc_uuid_to_peer() initializes its 2nd parameter
* before accessing its values.
*/
- /* coverity[uninit_use_in_call] */
err = ptlrpc_uuid_to_peer(uuid, &peer, &self, refnet);
if (err != 0) {
CNETERR("cannot find peer %s!\n", uuid->uuid);
err = ptlrpc_uuid_to_peer(uuid, &peer, &self, refnet);
if (err != 0) {
CNETERR("cannot find peer %s!\n", uuid->uuid);
sigact.sa_handler = signal_server;
sigfillset(&sigact.sa_mask);
sigact.sa_flags = SA_RESTART;
sigact.sa_handler = signal_server;
sigfillset(&sigact.sa_mask);
sigact.sa_flags = SA_RESTART;
- /* coverity[uninit_use_in_call] */
sigaction(SIGINT, &sigact, NULL);
shmem_cleanup();
sigaction(SIGINT, &sigact, NULL);
shmem_cleanup();