Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi: qla2xxx: Fix BSG request hang on flash image validation failure
@ 2026-07-04 17:46 Guangshuo Li
  2026-07-04 17:58 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Guangshuo Li @ 2026-07-04 17:46 UTC (permalink / raw)
  To: Nilesh Javali, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, Anil Gurumurthy, Himanshu Madhani, linux-scsi,
	linux-kernel
  Cc: Guangshuo Li

qla28xx_validate_flash_image() validates a flash image and reports the
result through the BSG reply. It only calls bsg_job_done() when the
validation succeeds.

However, the function always returns QLA_SUCCESS. If validation fails,
bsg_job_done() is skipped but the zero return value tells the BSG core
that the request was accepted and will be completed asynchronously. No
one completes the request afterwards, so the BSG request remains
in-flight until it times out.

Return the validation error when bsg_job_done() is not called. This lets
the BSG core complete the request with an error instead of waiting for a
completion that will never happen.

Fixes: c2c68225b145 ("scsi: qla2xxx: Fix bsg_done() causing double free")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
 drivers/scsi/qla2xxx/qla_bsg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index 5e910b5ca670..5b2201859f73 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -3369,5 +3369,5 @@ static int qla28xx_validate_flash_image(struct bsg_job *bsg_job)
 		bsg_job_done(bsg_job, bsg_reply->result,
 			     bsg_reply->reply_payload_rcv_len);
 
-	return QLA_SUCCESS;
+	return rval;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-04 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-04 17:46 [PATCH] scsi: qla2xxx: Fix BSG request hang on flash image validation failure Guangshuo Li
2026-07-04 17:58 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox