The niov calculation in kgnilnd_setup_immediate_buffer() did not take
into account an offset kiov which can cause it to map one less page
than needed.
Add in the kiov_offset to the calculation.
Ran patched lnet_selftest that allows specifying an offset and
observed correct behavior.
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Id3d500d178841aa803c35bcbb7b56fd13b3fc1b0
Reviewed-on: http://review.whamcloud.com/18793
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
} else if (kiov != NULL) {
if ((niov > 0) && unlikely(niov > (nob/PAGE_SIZE))) {
- niov = ((nob + offset + PAGE_SIZE - 1) / PAGE_SIZE);
+ niov = ((nob + offset + kiov->kiov_offset + PAGE_SIZE - 1) /
+ PAGE_SIZE);
}
LASSERTF(niov > 0 && niov < GNILND_MAX_IMMEDIATE/PAGE_SIZE,