lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1436198680-8303-1-git-send-email-hofrat@osadl.org>
Date:	Mon,  6 Jul 2015 18:04:40 +0200
From:	Nicholas Mc Guire <hofrat@...dl.org>
To:	Nicholas Bellinger <nab@...ux-iscsi.org>
Cc:	Christoph Hellwig <hch@....de>,
	Saurav Kashyap <saurav.kashyap@...gic.com>,
	Bart Van Assche <bart.vanassche@...disk.com>,
	Himanshu Madhani <himanshu.madhani@...gic.com>,
	linux-kernel@...r.kernel.org, Nicholas Mc Guire <hofrat@...dl.org>
Subject: [PATCH] tcm_qla2xxx: pass timeout as HZ independent value

API compliance scanning with coccinelle flagged:
./drivers/scsi/qla2xxx/tcm_qla2xxx.c:407:2-29:
         WARNING: timeout is HZ dependent

This was introduced in 'commit 75f8c1f693ee ("[SCSI] tcm_qla2xxx: Add >=
24xx series fabric module for target-core")'. wait_for_completion_timeout()
expects a timeout in jiffies so the numeric constant makes the effective 
timeout HZ dependent. Resolved by converting it to CONST * HZ.

Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
---

As the intended timeout is not documented I'm guessing that it should be
3000 milliseconds but someone that knows the driver needs to check if that
is a reasonable guess.

Further its not clear why the timeout event if it were to occure does not
produce some debug message and/or pass it up through the return value.

Patch was compile tested with x86_64_defconfig + CONFIG_SCSI_LOWLEVEL=y,
CONFIG_SCSI_FC_ATTRS=y, CONFIG_TARGET_CORE=m, CONFIG_LIBFC=m,
CONFIG_SCSI_QLA_FC=m, CONFIG_TCM_QLA2XXX=m

Patch is against 4.2-rc1 (localversion-next is -next-20150706)

 drivers/scsi/qla2xxx/tcm_qla2xxx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index d9a8c60..33364b6 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -405,7 +405,7 @@ static int tcm_qla2xxx_write_pending_status(struct se_cmd *se_cmd)
 	    se_cmd->t_state == TRANSPORT_COMPLETE_QF_WP) {
 		spin_unlock_irqrestore(&se_cmd->t_state_lock, flags);
 		wait_for_completion_timeout(&se_cmd->t_transport_stop_comp,
-						3000);
+					    3 * HZ);
 		return 0;
 	}
 	spin_unlock_irqrestore(&se_cmd->t_state_lock, flags);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ