From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Adaptec OEM Raid Solutions <aacraid@microsemi.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] scsi: aacraid: Replace one-element array with flexible-array member
Date: Wed, 24 Mar 2021 21:18:14 -0400 [thread overview]
Message-ID: <yq135wkm410.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20210304203822.GA102218@embeddedor> (Gustavo A. R. Silva's message of "Thu, 4 Mar 2021 14:38:22 -0600")
Hi Gustavo!
Your changes and the original code do not appear to be functionally
equivalent.
> @@ -1235,8 +1235,8 @@ static int aac_read_raw_io(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u3
> if (ret < 0)
> return ret;
> command = ContainerRawIo2;
> - fibsize = sizeof(struct aac_raw_io2) +
> - ((le32_to_cpu(readcmd2->sgeCnt)-1) * sizeof(struct sge_ieee1212));
> + fibsize = struct_size(readcmd2, sge,
> + le32_to_cpu(readcmd2->sgeCnt));
The old code allocated sgeCnt-1 elements (whether that was a mistake or
not I do not know) whereas the new code would send a larger fib to the
ASIC. I don't have any aacraid adapters and I am hesitant to merging
changes that have not been validated on real hardware.
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2021-03-25 1:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-04 20:38 [PATCH][next] scsi: aacraid: Replace one-element array with flexible-array member Gustavo A. R. Silva
2021-03-25 1:18 ` Martin K. Petersen [this message]
2021-03-25 0:46 ` Gustavo A. R. Silva
2021-03-26 3:34 ` Martin K. Petersen
2021-03-26 3:07 ` Gustavo A. R. Silva
2021-04-07 19:22 ` Kees Cook
2021-04-13 4:52 ` Martin K. Petersen
2021-04-13 5:45 ` Gustavo A. R. Silva
2021-04-13 14:04 ` James Bottomley
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=yq135wkm410.fsf@ca-mkp.ca.oracle.com \
--to=martin.petersen@oracle.com \
--cc=aacraid@microsemi.com \
--cc=gustavoars@kernel.org \
--cc=jejb@linux.ibm.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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.