From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin K. Petersen" Subject: Re: bug report: sd: off by one in sd_read_block_limits() Date: Tue, 02 Mar 2010 08:36:35 -0500 Message-ID: References: <20100302082135.GA6218@bicker> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from rcsinet12.oracle.com ([148.87.113.124]:64740 "EHLO rcsinet12.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753196Ab0CBNit (ORCPT ); Tue, 2 Mar 2010 08:38:49 -0500 In-Reply-To: (Martin K. Petersen's message of "Tue, 02 Mar 2010 08:21:41 -0500") Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: "James E.J. Bottomley" Cc: Matthew Wilcox , Dan Carpenter , linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org 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