Whamcloud - gitweb
LU-8726 osd-ldiskfs: bypass read for benchmarking
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_io.c
index 7713af9..3434634 100644 (file)
@@ -1352,6 +1352,10 @@ static int osd_read_prep(const struct lu_env *env, struct dt_object *dt,
                else
                        lnb[i].lnb_rc = lnb[i].lnb_len;
 
+               /* Bypass disk read if fail_loc is set properly */
+               if (OBD_FAIL_CHECK(OBD_FAIL_OST_FAKE_RW))
+                       SetPageUptodate(lnb[i].lnb_page);
+
                if (PageUptodate(lnb[i].lnb_page)) {
                        cache_hits++;
                } else {