From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Dashi DS1 Cao <caods1@lenovo.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
stable <stable@vger.kernel.org>
Subject: Re: version 3.18.44 to 3.18.45 introduced a bug in "drivers/scsi/megaraid/megaraid_sas_base.c"
Date: Tue, 13 Dec 2016 08:30:13 -0800 [thread overview]
Message-ID: <20161213163013.GB20693@kroah.com> (raw)
In-Reply-To: <a9788b9c-6361-f79e-f851-e8c4871571cb@infradead.org>
On Tue, Dec 13, 2016 at 08:08:27AM -0800, Randy Dunlap wrote:
> [adding other lists + gregkh]
>
>
> On 12/13/16 02:56, Dashi DS1 Cao wrote:
> > --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> > @@ -1614,16 +1614,13 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
> > goto out_done;
> > }
> >
> > - switch (scmd->cmnd[0]) {
> > - case SYNCHRONIZE_CACHE:
> > - /*
> > - * FW takes care of flush cache on its own
> > - * No need to send it down
> > - */
> > + /*
> > + * FW takes care of flush cache on its own for Virtual Disk.
> > + * No need to send it down for VD. For JBOD send SYNCHRONIZE_CACHE to FW.
> > + */
> > + if ((scmd->cmnd[0] == SYNCHRONIZE_CACHE) && MEGASAS_IS_LOGICAL(scmd)) {
> > scmd->result = DID_OK << 16;
> > goto out_done;
> > - default:
> > - break;
> > }
> >
> > if (instance->instancet->build_and_issue_cmd(instance, scmd)) {
> >
> > MEGASAS_IS_LOGICAL is defined to be a macro with '?' operator, which has a lower precedence than '&&'.
> > The macro should have been defined as:
> > --- a/drivers/scsi/megaraid/megaraid_sas.h
> > +++ b/drivers/scsi/megaraid/megaraid_sas.h
> > @@ -1823,7 +1823,7 @@ struct megasas_instance_template {
> > };
> >
> > #define MEGASAS_IS_LOGICAL(scp) \
> > - (scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1
> > + ((scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1)
> >
> > #define MEGASAS_DEV_INDEX(inst, scp) \
> > ((scp->device->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) + \
> >
> > Dashi Cao
> >
I don't maintain 3.18-stable :)
thanks,
greg k-h
next prev parent reply other threads:[~2016-12-13 16:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-13 10:56 version 3.18.44 to 3.18.45 introduced a bug in "drivers/scsi/megaraid/megaraid_sas_base.c" Dashi DS1 Cao
2016-12-13 16:08 ` Randy Dunlap
2016-12-13 16:30 ` Greg Kroah-Hartman [this message]
2016-12-13 16:33 ` Randy Dunlap
2016-12-13 16:43 ` James Bottomley
2016-12-13 16:47 ` Greg Kroah-Hartman
2016-12-13 20:51 ` alexander.levin
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=20161213163013.GB20693@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=caods1@lenovo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=rdunlap@infradead.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.