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]
Date: Fri,  5 Apr 2024 16:16:01 +0900
From: SEO HOYOUNG <hy50.seo@...sung.com>
To: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
	alim.akhtar@...sung.com, avri.altman@....com, jejb@...ux.ibm.com,
	martin.petersen@...cle.com, beanhuo@...ron.com, bvanassche@....org,
	kwangwon.min@...sung.com, kwmad.kim@...sung.com, sh425.lee@...sung.com,
	quic_nguyenb@...cinc.com, cpgs@...sung.com, h10.kim@...sung.com
Cc: SEO HOYOUNG <hy50.seo@...sung.com>
Subject: [PATCH v1] scsi: ufs: core: changing the status to check inflight

According to below the patch applied, lrbp->cmd do not will NULL
after call release_scsi_cmd()
So check the rq->state unconditionally even if it is completed normally
in ufshcd_cmd_inflight()

If occurred abort status and tm_cmd timeout, will run err_handler
for re-init UFS.
Then err_handler will check pending request for clearing cmd.
At that time, check if the state of rq is not MQ_RQ_IDLE.
In other words, check if it is MQ_RQ_COMPLETE or MQ_RQ_IN_FLIGHT.
If rq->state is MQ_RQ_COMPLETE, it is already completed in the block,
so there is no need to process the queue.

Link: https://lore.kernel.org/linux-scsi/20230517223157.1068210-3-bvanassche@acm.org/
Signed-off-by: SEO HOYOUNG <hy50.seo@...sung.com>
---
 drivers/ufs/core/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 21429eec1b82..3f47ea584cb1 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -3088,7 +3088,7 @@ bool ufshcd_cmd_inflight(struct scsi_cmnd *cmd)
 		return false;
 
 	rq = scsi_cmd_to_rq(cmd);
-	if (!blk_mq_request_started(rq))
+	if (blk_mq_rq_state(rq) != MQ_RQ_IN_FLIGHT)
 		return false;
 
 	return true;
-- 
2.26.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ