NVMe: Correct sg list setup in nvme_map_user_pages
authorMatthew Wilcox <matthew.r.wilcox@intel.com>
Tue, 13 Sep 2011 21:01:39 +0000 (17:01 -0400)
committerMatthew Wilcox <matthew.r.wilcox@intel.com>
Fri, 4 Nov 2011 19:53:04 +0000 (15:53 -0400)
commitd0ba1e497bca83a3d353eb47c9658afc54d83228
tree67357b1a15493caf232448fc8f5c13bf73fbe215
parent6413214c5d424fd5aae6567848340f962ad2ce0f
NVMe: Correct sg list setup in nvme_map_user_pages

Our SG list was constructed to always fill the entire first page, even
if that was more than the length of the I/O.  This is probably harmless,
but some IOMMUs might do something bad.

Correcting the first call to sg_set_page() made it look a lot closer to
the sg_set_page() in the loop, so fold the first call to sg_set_page()
into the loop.

Reported-by: Nisheeth Bhat <nisheeth.bhat@intel.com>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
drivers/block/nvme.c