csiostor:Fix locking requirements for function call in the function csio_alloc_rnode
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 44 lines
-----Original Message-----
From: Nicholas Krause [mailto:[email protected]]
Sent: Thursday, September 3, 2015 10:44 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Anish Bhatt; Hariprasad S; [email protected]; linux- [email protected]
Subject: [PATCH] csiostor:Fix locking requirements for function call in the functioncsio_alloc_rnodeThis fixes locking requirements for the function call to the function
csio_rnode_initto properly lock and disable irqs before calling this function withspin_lock_irqon the structure pointer hw of typecsio_hwand unlocking after the function call withspin_unlock_irqin order to prevent concurrent access on the shared structure pointer hw of typecsio_hwwith other threads of execution accessing this structureSigned-off-by Nicholas Krause <[email protected]>--- drivers/scsi/csiostor/csio_rnode.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/scsi/csiostor/csio_rnode.c +6
-3@@ -222,9 +222,13 @@ csio_alloc_rnode(struct csio_lnode *ln) goto err;memset (rn,0 ,sizeof (struct csio_rnode )); -if (csio_rnode_init (rn, ln)) +spin_lock_irq (&hw->lock); +if (csio_rnode_init (rn, ln)) { +spin_unlock_irq (&hw->lock); goto err_free; - + } + +spin_unlock_irq (&hw->lock);CSIO_INC_STATS (ln, n_rnode_alloc);return rn; --
Quoted 1 line
2.1.4
NACK. Function called from csio_fcoe_fwevt_handler() with lock held.