csiostor:Fix locking issues in the function csio_scsim_cleanup_io_lnode
Quoted 18 lines · Nicholas Krause
This fixes locking issues in the function
csio_scsim_cleanup_io_lnodeby locking around the call to the functioncsio_csci_gather_active_ioswith 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 typecsio_hwas this structure pointer can be shared across mutliple threads in the kernel.Signed-off-by Nicholas Krause <[email protected]>--- drivers/scsi/csiostor/csio_scsi.c | 2 ++ 1 file changed, 2 insertions(+)drivers/scsi/csiostor/csio_scsi.c +0
-0
drivers/scsi/csiostor/csio_scsi.c csio_scsim_cleanup_io_lnode(struct csio_scsim *scm, struct csio_lnode *ln) · line 1332
Quoted 6 lines
drivers/scsi/csiostor/csio_scsi.c +2
-0@@ -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);
All the callers grab that lock, you've just added a deadlock instead.
Nick, I've said this before and I'll say this again. Stop sending me patches. They are all untested and broken, you are wasting peoples time.
Signature · 1 line
Jens Axboe