]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nvme: fix max_segments integer truncation
authorAshok Vairavan <ashok.vairavan@oracle.com>
Thu, 27 Oct 2016 19:31:52 +0000 (12:31 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 28 Oct 2016 00:51:49 +0000 (17:51 -0700)
commit3aa123dee7264ee9ab9c2876fa541a8dc8f08e73
tree69e5264d885b855c53c2fa0c89cb1d0e7735292d
parenta9d43e0881325251ac2a06280ecf7e29732a8c8e
nvme: fix max_segments integer truncation

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@lst.de>
Reported-by: Jeff Lien <Jeff.Lien@hgst.com>
Tested-by: Jeff Lien <Jeff.Lien@hgst.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Orabug: 24928835
Cherry picked commit: 45686b6198bd824f083ff5293f191d78db9d708a
Conflicts:
UEK4 QU2 nvme module doesn't have core.c file. All the functions
resides in pci.c. Hence, this patch is manually ported to the respective
function in pci.c
drivers/nvme/host/core.c

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
drivers/nvme/host/pci.c