IB/srp: Fix infinite loop when FMR sg[0].offset != 0
authorBart Van Assche <bart.vanassche@sandisk.com>
Mon, 26 Sep 2016 19:58:49 +0000 (12:58 -0700)
committerDoug Ledford <dledford@redhat.com>
Fri, 7 Oct 2016 20:54:39 +0000 (16:54 -0400)
commit681cc3608355737c1effebc8145f95c8c3344bc3
tree440c6dc95990989c80eaeac571a01c88efce3d7a
parent52bb8c626e0e5526c72b6ad17f1381f0bad283cc
IB/srp: Fix infinite loop when FMR sg[0].offset != 0

Avoid that mapping an sg-list in which the first element has a
non-zero offset triggers an infinite loop when using FMR. This
patch makes the FMR mapping code similar to that of ib_sg_to_pages().

Note: older Mellanox HCAs do not support non-zero offsets for FMR.
See also commit 8c4037b501ac ("IB/srp: always avoid non-zero offsets
into an FMR").

Reported-by: Alex Estrin <alex.estrin@intel.com>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/srp/ib_srp.c