From: Johannes Thumshirn <jthumshirn@suse.de>
To: John Garry <john.garry@huawei.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
Linux SCSI Mailinglist <linux-scsi@vger.kernel.org>,
Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>,
qla2xxx-upstream@qlogic.com,
Himanshu Madhani <himanshu.madhani@cavium.com>
Subject: Re: [PATCH] qla2xxx: Protect access to qpair members with qpair->qp_lock
Date: Thu, 22 Jun 2017 16:23:20 +0200 [thread overview]
Message-ID: <20170622142320.GP5670@linux-x5ow.site> (raw)
In-Reply-To: <dd855f97-49f3-17ef-1d3b-857effa50bc9@huawei.com>
On Thu, Jun 22, 2017 at 03:19:27PM +0100, John Garry wrote:
> On 22/06/2017 14:43, Johannes Thumshirn wrote:
> >In qla2xx_start_scsi_mq() and qla2xx_dif_start_scsi_mq() we grab the
> >qpair->qp_lock but do access members of the qpair before having the lock.
> >Re-order the locking sequence to have all read and write access to qpair
> >members under the qpair->qp_lock.
> >
> >Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> >---
> > drivers/scsi/qla2xxx/qla_iocb.c | 20 +++++++++++++-------
> > 1 file changed, 13 insertions(+), 7 deletions(-)
> >
> >diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
> >index 8404f17f3c6c..425ca1646a9a 100644
> >--- a/drivers/scsi/qla2xxx/qla_iocb.c
> >+++ b/drivers/scsi/qla2xxx/qla_iocb.c
> >@@ -1770,10 +1770,6 @@ qla2xxx_start_scsi_mq(srb_t *sp)
> > struct qla_hw_data *ha = vha->hw;
> > struct qla_qpair *qpair = sp->qpair;
> >
> >- /* Setup qpair pointers */
> >- rsp = qpair->rsp;
> >- req = qpair->req;
>
> Can you check the call to qla2x00_marker() before the spinlock grab, which
> takes rsp and req as parameters?
Good catch, thanks.
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
next prev parent reply other threads:[~2017-06-22 14:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 13:43 [PATCH] qla2xxx: Protect access to qpair members with qpair->qp_lock Johannes Thumshirn
2017-06-22 13:53 ` Hannes Reinecke
2017-06-22 14:19 ` John Garry
2017-06-22 14:23 ` Johannes Thumshirn [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-06-23 22:04 Malavali, Giridhar
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=20170622142320.GP5670@linux-x5ow.site \
--to=jthumshirn@suse.de \
--cc=himanshu.madhani@cavium.com \
--cc=john.garry@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=qla2xxx-upstream@qlogic.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).