mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 05:01:27 +00:00
The most recent version of the sparse static source code checking tool does
now report functions that are called with a lock held but that are missing __acquires() and __releases() annotations. The patch below adds such annotations and makes the following sparse warnings disappear: drivers/scst/iscsi-scst/iscsi.c:2861:9: warning: context imbalance in 'iscsi_check_send_delayed_tm_resp' - unexpected unlock drivers/scst/iscsi-scst/nthread.c:1614:17: warning: context imbalance in 'scst_do_job_wr' - unexpected unlock drivers/scst/iscsi-scst/iscsi.c:2861:9: warning: context imbalance in 'iscsi_check_send_delayed_tm_resp' - unexpected unlock drivers/scst/iscsi-scst/nthread.c:1614:17: warning: context imbalance in 'scst_do_job_wr' - unexpected unlock drivers/scst/scst_local/scst_local.c:554:30: warning: context imbalance in 'scst_local_queuecommand' - unexpected unlock The patch below has been tested by comparing the output of "scripts/run-regression-tests 2.6.30.3" before and after the patch was applied. Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@982 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2850,6 +2850,8 @@ static bool iscsi_is_delay_tm_resp(struct iscsi_cmnd *rsp)
|
||||
|
||||
/* Called under sn_lock, but might drop it inside, then reaquire */
|
||||
static void iscsi_check_send_delayed_tm_resp(struct iscsi_session *sess)
|
||||
__acquires(&sn_lock)
|
||||
__releases(&sn_lock)
|
||||
{
|
||||
struct iscsi_cmnd *tm_rsp = sess->tm_rsp;
|
||||
|
||||
|
||||
@@ -910,6 +910,8 @@ static int process_read_io(struct iscsi_conn *conn, int *closed)
|
||||
* then reaquire.
|
||||
*/
|
||||
static void scst_do_job_rd(void)
|
||||
__acquires(&iscsi_rd_lock)
|
||||
__releases(&iscsi_rd_lock)
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -1591,6 +1593,8 @@ static int process_write_queue(struct iscsi_conn *conn)
|
||||
* then reaquire.
|
||||
*/
|
||||
static void scst_do_job_wr(void)
|
||||
__acquires(&iscsi_wr_lock)
|
||||
__releases(&iscsi_wr_lock)
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
@@ -455,6 +455,8 @@ static int scst_local_send_resp(struct scsi_cmnd *cmnd,
|
||||
*/
|
||||
static int scst_local_queuecommand(struct scsi_cmnd *SCpnt,
|
||||
void (*done)(struct scsi_cmnd *))
|
||||
__acquires(&h->host_lock)
|
||||
__releases(&h->host_lock)
|
||||
{
|
||||
struct scst_local_tgt_specific *tgt_specific = NULL;
|
||||
struct scst_local_host_info *scst_lcl_host;
|
||||
|
||||
Reference in New Issue
Block a user