linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] csiostor: Fix backwards locking in the function __csio_unreg_rnode
@ 2016-04-05 21:19 Bastien Philbert
  2016-04-06  7:48 ` Julian Calaby
  0 siblings, 1 reply; 14+ messages in thread
From: Bastien Philbert @ 2016-04-05 21:19 UTC (permalink / raw)
  To: jejb; +Cc: martin.petersen, linux-scsi, linux-kernel

This fixes backwards locking in the function __csio_unreg_rnode to
properly lock before the call to the function csio_unreg_rnode and
not unlock with spin_unlock_irq as this would not allow the proper
protection for concurrent access on the shared csio_hw structure
pointer hw. In addition switch the locking after the critical region
function call to properly unlock instead with spin_unlock_irq on

Signed-off-by: Bastien Philbert <bastienphilbert@gmail.com>
---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/csiostor/csio_rnode.c b/drivers/scsi/csiostor/csio_rnode.c
index e9c3b04..029a09e 100644
--- a/drivers/scsi/csiostor/csio_rnode.c
+++ b/drivers/scsi/csiostor/csio_rnode.c
@@ -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)
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread
[parent not found: <1441300143-1143-1-git-send-email-xerofoify@gmail.com>]

end of thread, other threads:[~2016-04-06 19:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-05 21:19 [PATCH] csiostor: Fix backwards locking in the function __csio_unreg_rnode Bastien Philbert
2016-04-06  7:48 ` Julian Calaby
2016-04-06 13:21   ` Bastien Philbert
2016-04-06 13:38     ` James Bottomley
2016-04-06 14:11       ` Bastien Philbert
2016-04-06 14:24         ` James Bottomley
2016-04-06 14:36           ` Bastien Philbert
2016-04-06 17:14             ` James Bottomley
2016-04-06 17:23               ` Bastien Philbert
2016-04-06 17:28                 ` James Bottomley
2016-04-06 17:35                   ` Bastien Philbert
2016-04-06 18:41                   ` Greg KH
2016-04-06 19:34                     ` Theodore Ts'o
     [not found] <1441300143-1143-1-git-send-email-xerofoify@gmail.com>
2015-09-04 22:44 ` [PATCH] csiostor:Fix " Anish Bhatt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).