From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: "James E.J. Bottomley" <James.Bottomley@suse.de>
Cc: Matthew Wilcox <matthew@wil.cx>,
Dan Carpenter <error27@gmail.com>,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: bug report: sd: off by one in sd_read_block_limits()
Date: Tue, 02 Mar 2010 08:36:35 -0500 [thread overview]
Message-ID: <yq1fx4i26cc.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <yq1k4tu2716.fsf@sermon.lab.mkp.net> (Martin K. Petersen's message of "Tue, 02 Mar 2010 08:21:41 -0500")
James,
While I agree the original VPD code's double kmalloc() was a bit of a
wart at least it did the right thing because it allocated a suitably
sized buffer for page 0.
My concern with the interface you introduced in e3deec09 is that for
devices that support a large number of VPD pages we won't be able to fit
the page list in the allocated buffer. And callers are likely to pick a
buffer size that makes sense for the VPD page they are interested in.
It's not a big deal in the block limits/block device characteristics
case because they are big enough.
But at the very minimum that interface should come with a big fat
warning in the comment section that describes that the page list must
also be able to fit.
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2010-03-02 13:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-02 8:21 bug report: sd: off by one in sd_read_block_limits() Dan Carpenter
2010-03-02 13:12 ` Martin K. Petersen
2010-03-02 13:21 ` Martin K. Petersen
2010-03-02 13:31 ` Matthew Wilcox
2010-03-02 13:36 ` Martin K. Petersen [this message]
2010-03-02 14:56 ` Matthew Wilcox
2010-03-03 7:08 ` James Bottomley
2010-03-02 13:44 ` Martin K. Petersen
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=yq1fx4i26cc.fsf@sermon.lab.mkp.net \
--to=martin.petersen@oracle.com \
--cc=James.Bottomley@suse.de \
--cc=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
/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