summaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi/iscsi_target.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2020-12-20 21:36:34 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2021-01-22 20:25:25 -0500
commitefc9d73063c15f1aba8920b9f9ceaba4f3fb8ed9 (patch)
tree7a64f7b472e603c4edfd45652a466f27598f0624 /drivers/target/iscsi/iscsi_target.c
parent433675486af4635416f8ece70b92b020a5b91005 (diff)
downloadlinux-efc9d73063c15f1aba8920b9f9ceaba4f3fb8ed9.tar.bz2
scsi: target: iscsi: Avoid in_interrupt() usage in iscsit_check_session_usage_count()
iscsit_check_session_usage_count() uses in_interrupt() to find out if it is safe to invoke wait_for_completion(). The usage of in_interrupt() in drivers is phased out and Linus clearly requested that code which changes behaviour depending on context should either be separated or the context be conveyed in an argument passed by the caller, which usually knows the context. There is only one caller of iscsit_check_session_usage_count() which already has an argument indicating if it is safe to sleep. Extend iscsit_check_session_usage_count() by an argument indicating if it may sleep. Link: https://lore.kernel.org/r/20201220203638.43615-3-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target.c')
-rw-r--r--drivers/target/iscsi/iscsi_target.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 5abf03125388..13de37ff9dc9 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4400,9 +4400,9 @@ int iscsit_close_session(struct iscsi_session *sess, bool can_sleep)
* restart the timer and exit.
*/
if (can_sleep) {
- iscsit_check_session_usage_count(sess);
+ iscsit_check_session_usage_count(sess, can_sleep);
} else {
- if (iscsit_check_session_usage_count(sess) == 2) {
+ if (iscsit_check_session_usage_count(sess, can_sleep) == 2) {
atomic_set(&sess->session_logout, 0);
iscsit_start_time2retain_handler(sess);
return 0;