[PATCH 3/5] nvme: fix max_segments integer truncation

Keith Busch keith.busch at intel.com
Wed Mar 2 10:27:58 PST 2016


On Wed, Mar 02, 2016 at 06:07:12PM +0100, Christoph Hellwig wrote:
> The block layer uses an unsigned short for max_segments.  The way we
> calculate the value for NVMe tends to generate very large 32-bit values,
> which after integer truncation may lead to a zero value instead of
> the desired outcome.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> Reported-by: Jeff Lien <Jeff.Lien at hgst.com>
> Tested-by: Jeff Lien <Jeff.Lien at hgst.com>

Looks good.

Reviewed-by: Keith Busch <keith.busch at intel.com>



More information about the Linux-nvme mailing list