All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Madhani, Himanshu" <Himanshu.Madhani@cavium.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 2/2] qla2xxx: Fix inadequate lock protection for ABTS.
Date: Fri, 31 Mar 2017 14:14:00 +0000	[thread overview]
Message-ID: <E0E66439-9982-4A4C-AAE3-69FA0A97FCB9@cavium.com> (raw)
In-Reply-To: <20170331074628.GA25012@kroah.com>

Hi Greg, 

> On Mar 31, 2017, at 12:46 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> 
> On Thu, Mar 30, 2017 at 09:18:53AM -0700, Himanshu Madhani wrote:
>> 
>> 
>> On Thu, 30 Mar 2017, 1:38am, Greg KH wrote:
>> 
>>> On Tue, Mar 28, 2017 at 12:50:20PM -0700, Himanshu Madhani wrote:
>>>> From: Quinn Tran <quinn.tran@cavium.com>
>>>> 
>>>> commit 8f6fc8d4e7ae2347d6261d11a7eb2b247d2954d8 upstream.
>>>> 
>>>> Normally, ABTS is sent to Target Core as Task MGMT command.
>>>> In the case of error, qla2xxx needs to send response, hardware_lock
>>>> is required to prevent request queue corruption.
>>>> 
>>>> Cc: <stable@vger.kernel.org>
>>>> Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
>>>> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
>>>> ---
>>>> drivers/scsi/qla2xxx/qla_target.c | 11 ++++++++++-
>>>> 1 file changed, 10 insertions(+), 1 deletion(-)
>>>> 
>>>> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
>>>> index 26fe9cb3a963..e2e71e0de857 100644
>>>> --- a/drivers/scsi/qla2xxx/qla_target.c
>>>> +++ b/drivers/scsi/qla2xxx/qla_target.c
>>>> @@ -120,6 +120,9 @@ static void qlt_send_notify_ack(struct scsi_qla_host *vha,
>>>> 	uint16_t srr_flags, uint16_t srr_reject_code, uint8_t srr_explan);
>>>> static void qlt_send_term_imm_notif(struct scsi_qla_host *vha,
>>>> 	struct imm_ntfy_from_isp *imm, int ha_locked);
>>>> +static void qlt_24xx_handle_abts(struct scsi_qla_host *,
>>>> +	struct abts_recv_from_24xx *);
>>>> +
>>>> /*
>>>>  * Global Variables
>>>>  */
>>>> @@ -357,6 +360,8 @@ void qlt_response_pkt_all_vps(struct scsi_qla_host *vha, response_t *pkt)
>>>> 		    (struct abts_recv_from_24xx *)pkt;
>>>> 		struct scsi_qla_host *host = qlt_find_host_by_vp_idx(vha,
>>>> 		    entry->vp_index);
>>>> +		unsigned long flags;
>>>> +
>>>> 		if (unlikely(!host)) {
>>>> 			ql_dbg(ql_dbg_tgt, vha, 0xe044,
>>>> 			    "qla_target(%d): Response pkt "
>>>> @@ -364,7 +369,11 @@ void qlt_response_pkt_all_vps(struct scsi_qla_host *vha, response_t *pkt)
>>>> 			    "vp_index %d\n", vha->vp_idx, entry->vp_index);
>>>> 			break;
>>>> 		}
>>>> -		qlt_response_pkt(host, pkt);
>>>> +		if (!ha_locked)
>>>> +			spin_lock_irqsave(&host->hw->hardware_lock, flags);
>>>> +		qlt_24xx_handle_abts(host, (struct abts_recv_from_24xx *)atio);
>>>> +		if (!ha_locked)
>>>> +			spin_unlock_irqrestore(&host->hw->hardware_lock, flags);
>>>> 		break;
>>>> 	}
>>>> 
>>> 
>>> You didn't test build this patch did you :(
>>> 
>>> Please do so, it breaks the build here on my end.  I'll drop it from my
>>> queue, please fix this up _properly_ and resend after you have tested it
>>> out.
>>> 
>> 
>> Apologies for the wrong backport. Looks like original patch has not yet 
>> made it into 4.10 stable. So this backport is not needed at this time.
> 
> What "original patch”?

This patch (2/2) fixes issue which was introduced by following patch.
 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/scsi/qla2xxx?id=41dc529a4602ac737020f423f84686a81de38e6d

> 
> Does that mean that patch 1/2 of this series should also be dropped?
> 

No 1/2 patch is independent of the this patch. 

> totally confused,
> 
> greg k-h

Thanks,
- Himanshu


      reply	other threads:[~2017-03-31 14:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 19:50 [PATCH 0/2] qla2xxx: Stable Backports for 4.10 Himanshu Madhani
2017-03-28 19:50 ` [PATCH 1/2] qla2xxx: Allow vref count to timeout on vport delete Himanshu Madhani
2017-03-28 19:50 ` [PATCH 2/2] qla2xxx: Fix inadequate lock protection for ABTS Himanshu Madhani
2017-03-30  8:38   ` Greg KH
2017-03-30 16:18     ` Himanshu Madhani
2017-03-31  7:46       ` Greg KH
2017-03-31 14:14         ` Madhani, Himanshu [this message]

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=E0E66439-9982-4A4C-AAE3-69FA0A97FCB9@cavium.com \
    --to=himanshu.madhani@cavium.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.