From: Anish Bhatt <anish@chelsio.com>
To: Nicholas Krause <xerofoify@gmail.com>,
"JBottomley@odin.com" <JBottomley@odin.com>,
Praveen Madhavan <praveenm@chelsio.com>
Cc: "hare@suse.de" <hare@suse.de>,
"michaelc@cs.wisc.edu" <michaelc@cs.wisc.edu>,
"davem@davemloft.net" <davem@davemloft.net>,
Hariprasad S <hariprasad@chelsio.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] csiostor:Fix backwards locking in the function __csio_unreg_rnode
Date: Fri, 4 Sep 2015 22:44:17 +0000 [thread overview]
Message-ID: <525DB349B3FB5444AE057A887CB2A8D893E43743@nice.asicdesigners.com> (raw)
In-Reply-To: <1441300143-1143-1-git-send-email-xerofoify@gmail.com>
> -----Original Message-----
> From: Nicholas Krause [mailto:xerofoify@gmail.com]
> Sent: Thursday, September 3, 2015 10:09 AM
> To: JBottomley@odin.com
> Cc: hare@suse.de; michaelc@cs.wisc.edu; davem@davemloft.net; Anish
> Bhatt; Hariprasad S; linux-scsi@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: [PATCH] csiostor:Fix backwards locking in the function
> __csio_unreg_rnode
>
> 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 the shared structure pointer.
>
> Signed-off-by: Nicholas Krause <xerofoify@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.1.4
NACK, function is called with lock held.
next parent reply other threads:[~2015-09-04 22:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1441300143-1143-1-git-send-email-xerofoify@gmail.com>
2015-09-04 22:44 ` Anish Bhatt [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=525DB349B3FB5444AE057A887CB2A8D893E43743@nice.asicdesigners.com \
--to=anish@chelsio.com \
--cc=JBottomley@odin.com \
--cc=davem@davemloft.net \
--cc=hare@suse.de \
--cc=hariprasad@chelsio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--cc=praveenm@chelsio.com \
--cc=xerofoify@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).