Patchwork [Open-FCoE,v2,07/16] scsi: libfc: don't set FC_RQST_STATE_DONE before calling fc_bsg_jobdone()

login
register
mail settings
Submitter Johannes Thumshirn
Date Oct. 12, 2016, 1:06 p.m.
Message ID <c0be09bd5581f7993618132ed4bced8e5cb62ce1.1476276823.git.jthumshirn@suse.de>
Download mbox | patch
Permalink /patch/346/
State New
Headers show

Comments

Johannes Thumshirn - Oct. 12, 2016, 1:06 p.m.
Don't set FC_RQST_STATE_DONE before calling fc_bsg_jobdone() as
fc_bsg_jobdone() calls blk_complete_requeust() which raises a soft-IRQ that
ends up in fc_bsg_sofirq_done() and fc_bsg_softirq_done() sets the
FC_RQST_STATE_DONE flag.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/scsi/libfc/fc_lport.c | 2 --
 1 file changed, 2 deletions(-)
Hannes Reinecke - Oct. 13, 2016, 11:38 a.m.
On 10/12/2016 03:06 PM, Johannes Thumshirn wrote:
> Don't set FC_RQST_STATE_DONE before calling fc_bsg_jobdone() as
> fc_bsg_jobdone() calls blk_complete_requeust() which raises a soft-IRQ that
> ends up in fc_bsg_sofirq_done() and fc_bsg_softirq_done() sets the
> FC_RQST_STATE_DONE flag.
> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  drivers/scsi/libfc/fc_lport.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
> index 156708a..53d13721 100644
> --- a/drivers/scsi/libfc/fc_lport.c
> +++ b/drivers/scsi/libfc/fc_lport.c
> @@ -1911,7 +1911,6 @@ static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp,
>  		bsg_reply->result = (PTR_ERR(fp) == -FC_EX_CLOSED) ?
>  			-ECONNABORTED : -ETIMEDOUT;
>  		job->reply_len = sizeof(uint32_t);
> -		job->state_flags |= FC_RQST_STATE_DONE;
>  		fc_bsg_jobdone(job, bsg_reply->result,
>  			       bsg_reply->reply_payload_rcv_len);
>  		kfree(info);
> @@ -1947,7 +1946,6 @@ static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp,
>  			bsg_reply->reply_payload_rcv_len =
>  				job->reply_payload.payload_len;
>  		bsg_reply->result = 0;
> -		job->state_flags |= FC_RQST_STATE_DONE;
>  		fc_bsg_jobdone(job, bsg_reply->result,
>  			       bsg_reply->reply_payload_rcv_len);
>  		kfree(info);
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes

Patch

diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 156708a..53d13721 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -1911,7 +1911,6 @@  static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp,
 		bsg_reply->result = (PTR_ERR(fp) == -FC_EX_CLOSED) ?
 			-ECONNABORTED : -ETIMEDOUT;
 		job->reply_len = sizeof(uint32_t);
-		job->state_flags |= FC_RQST_STATE_DONE;
 		fc_bsg_jobdone(job, bsg_reply->result,
 			       bsg_reply->reply_payload_rcv_len);
 		kfree(info);
@@ -1947,7 +1946,6 @@  static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp,
 			bsg_reply->reply_payload_rcv_len =
 				job->reply_payload.payload_len;
 		bsg_reply->result = 0;
-		job->state_flags |= FC_RQST_STATE_DONE;
 		fc_bsg_jobdone(job, bsg_reply->result,
 			       bsg_reply->reply_payload_rcv_len);
 		kfree(info);