> -----Original Message-----
> From: Nicholas Krause [mailto:xerofo...@gmail.com]
> Sent: Wednesday, September 2, 2015 10:36 AM
> To: jbottom...@odin.com
> Cc: h...@suse.de; micha...@cs.wisc.edu; da...@davemloft.net; Anish
> Bhatt; Hariprasad S; linux-s...@vger.kernel.org; linux-
> ker...@vger.kernel.org
> Subject: [PATCH] csiostor:Fix locking issues in the function
> csio_scsim_cleanup_io_lnode
> 
> This fixes locking issues in the function csio_scsim_cleanup_io_lnode by
> locking around the call to the function csio_csci_gather_active_ios with the
> function pair spin_lock_irq/spin_unlock_irq as any function calling this
> particular function must do in order to avoid concurrent threads of execution
> on the passed structure pointer of type csio_hw as this structure pointer can
> be shared across mutliple threads in the kernel.
> 
> Signed-off-by: Nicholas Krause <xerofo...@gmail.com>
> ---
>  drivers/scsi/csiostor/csio_scsi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/csiostor/csio_scsi.c 
> b/drivers/scsi/csiostor/csio_scsi.c
> index 2c4562d..c318855 100644
> --- a/drivers/scsi/csiostor/csio_scsi.c
> +++ b/drivers/scsi/csiostor/csio_scsi.c
> @@ -1327,7 +1327,9 @@ csio_scsim_cleanup_io_lnode(struct csio_scsim
> *scm, struct csio_lnode *ln)
>       sld.level = CSIO_LEV_LNODE;
>       sld.lnode = ln;
>       INIT_LIST_HEAD(&ln->cmpl_q);
> +     spin_lock_irq(&hw->lock);
>       csio_scsi_gather_active_ios(scm, &sld, &ln->cmpl_q);
> +     spin_unlock_irq(&hw->lock);
> 
>       /* No I/Os pending on this lnode  */
>       if (list_empty(&ln->cmpl_q))
> --
> 2.1.4

Acked-By:  Anish Bhatt <an...@chelsio.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to