Whamcloud - gitweb
LU-7850 gnilnd: Fix niov calculation with offset kiov
[fs/lustre-release.git] / lnet / klnds / gnilnd / gnilnd_cb.c
index ab86f2c..d9839ce 100644 (file)
@@ -507,7 +507,8 @@ kgnilnd_setup_immediate_buffer(kgn_tx_t *tx, unsigned int niov,
        } 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,
@@ -3072,7 +3073,7 @@ kgnilnd_reaper(void *arg)
                                    next_check_time);
                        mod_timer(&timer, (long) jiffies + timeout);
 
-                       /* check flag variables before comitting */
+                       /* check flag variables before committing */
                        if (!kgnilnd_data.kgn_shutdown &&
                            !kgnilnd_data.kgn_quiesce_trigger) {
                                CDEBUG(D_INFO, "schedule timeout %ld (%lu sec)\n",