diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 4a3ef1a70ed74e68ad45cbd269a83c49ba776fd7..e71fa07d1cb6c0a5351f30572b19860058067834 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2156,8 +2156,12 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, ret = BLK_STS_DEV_RESOURCE; break; default: + if (unlikely(!scsi_device_online(sdev))) + scsi_req(req)->result = DID_NO_CONNECT << 16; + else + scsi_req(req)->result = DID_ERROR << 16; /* - * Make sure to release all allocated ressources when + * Make sure to release all allocated resources when * we hit an error, as we will never see this command * again. */