Whamcloud - gitweb
LU-14436 tgt: only use T10PI guard when doing full sector read
[fs/lustre-release.git] / lustre / target / tgt_handler.c
index 45e3b30..4558c37 100644 (file)
@@ -2074,6 +2074,7 @@ static int tgt_checksum_niobuf_t10pi(struct lu_target *tgt,
                 * whole page
                 */
                if (t10_cksum_type && opc == OST_READ &&
+                   local_nb[i].lnb_len == PAGE_SIZE &&
                    local_nb[i].lnb_guard_disk) {
                        used = DIV_ROUND_UP(local_nb[i].lnb_len, sector_size);
                        if (used > (guard_number - used_number)) {
@@ -2700,6 +2701,8 @@ skip_transfer:
                }
        }
 
+       OBD_FAIL_TIMEOUT(OBD_FAIL_OST_BRW_PAUSE_BULK2, cfs_fail_val);
+
 out_commitrw:
        /* Must commit after prep above in all cases */
        rc = obd_commitrw(tsi->tsi_env, OBD_BRW_WRITE, exp, &repbody->oa,