csiostor:Fix backwards locking in the function __csio_unreg_rnode
A message that is not in the archive (sent off-list or not yet received): [email protected]
Anish Bhatt
NAKQuoted 41 lines
-----Original Message-----
From: Nicholas Krause [mailto:[email protected]]
Sent: Thursday, September 3, 2015 10:09 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Anish Bhatt; Hariprasad S; [email protected]; linux- [email protected]
Subject: [PATCH] csiostor:Fix backwards locking in the function__csio_unreg_rnodeThis fixes backwards locking in the function
__csio_unreg_rnodeto properly lock before the call to the functioncsio_unreg_rnodeand not unlock withspin_unlock_irqas this would not allow the proper protection for concurrent access on the sharedcsio_hwstructure pointer hw. In addition switch the locking after the critical region function call to properly unlock instead withspin_unlock_irqon the shared structure pointer.Signed-off-by Nicholas Krause <[email protected]>--- drivers/scsi/csiostor/csio_rnode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/scsi/csiostor/csio_rnode.c +2
-3@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode *rn) ln->last_scan_ntgts--; } -spin_unlock_irq (&hw->lock); -csio_unreg_rnode (rn);spin_lock_irq (&hw->lock); +csio_unreg_rnode (rn); +spin_unlock_irq (&hw->lock);/* Cleanup I/Os that were waiting for rnode to unregister */ if (cmpl) --
Quoted 1 line
2.1.4
NACK, function is called with lock held.