two small bsg fixes
Subsystems (3)
Two fixups for the recent bsg-lib fixups, should go into 4.13 stable as well.
PATCH 1/2 scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout
bsg-lib now embeddeds the job structure into the request, and req->special can't be used anymore.
--- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_fc.c +1 -1
@@ -3571,7 +3571,7 @@ fc_vport_sched_delete(struct work_struct *work)static enum blk_eh_timer_return fc_bsg_job_timeout (struct request *req) { -struct bsg_job *job = (void *) req->special; +struct bsg_job *job =blk_mq_rq_to_pdu (req->special);struct Scsi_Host *shost =fc_bsg_to_shost (job);struct fc_rport *rport =fc_bsg_to_rport (job);struct fc_internal *i =to_fc_internal (shost->transportt);
Signature · 1 line
2.11.0
Re: [PATCH 1/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout
Quoted 14 lines · Christoph Hellwig
bsg-lib now embeddeds the job structure into the request, and
req->specialcan't be used anymore.Signed-off-by Christoph Hellwig <[email protected]>--- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/scsi_transport_fc.c +0
-0
drivers/scsi/scsi_transport_fc.c fc_vport_sched_delete(struct work_struct *work) · line 3574
Quoted 5 lines
drivers/scsi/scsi_transport_fc.c +1
-1@@ -3571,7 +3571,7 @@ fc_vport_sched_delete(struct work_struct *work)static enum blk_eh_timer_return fc_bsg_job_timeout (struct request *req) { -struct bsg_job *job = (void *) req->special; +struct bsg_job *job =blk_mq_rq_to_pdu (req->special);
still req->special?
Signature · 1 line
Ming Lei
Re: [PATCH 1/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout
Quoted 10 lines · Ming Lei
Quoted 9 lines · Christoph Hellwig
bsg-lib now embeddeds the job structure into the request, and
req->specialcan't be used anymore.Signed-off-by Christoph Hellwig <[email protected]>--- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines
drivers/scsi/scsi_transport_fc.c fc_vport_sched_delete(struct work_struct *work) · line 3574
Quoted 10 lines
drivers/scsi/scsi_transport_fc.c +1
-1@@ -3571,7 +3571,7 @@ fc_vport_sched_delete(struct work_struct *work)static enum blk_eh_timer_return fc_bsg_job_timeout (struct request *req) { -struct bsg_job *job = (void *) req->special; +struct bsg_job *job =blk_mq_rq_to_pdu (req->special);still
req->special?
Meh, sent out before the rebase finished - I'll fix it up.
PATCH 2/2 bsg-lib: don't free job in bsg_prepare_job
In reply to Christoph HellwigThe job structure is allocated as part of the request, so we should not free it in the error path of bsg_prepare_job.
--- block/bsg-lib.c | 1 - 1 file changed, 1 deletion(-)
block/bsg-lib.c +0 -1
@@ -154,7 +154,6 @@ static int bsg_prepare_job(struct device *dev, struct request *req) failjob_rls_rqst_payload:kfree (job->request_payload.sg_list); failjob_rls_job: -kfree (job);return -ENOMEM ; }
Signature · 1 line
2.11.0