Whamcloud - gitweb
LU-13799 lov: Cache stripe offset calculation
[fs/lustre-release.git] / lustre / lov / lov_io.c
index 2b37380..1adb722 100644 (file)
@@ -480,6 +480,7 @@ static int lov_io_slice_init(struct lov_io *lio,
 
        io->ci_result = 0;
        lio->lis_object = obj;
+       lio->lis_cached_entry = LIS_CACHE_ENTRY_NONE;
 
        switch (io->ci_type) {
        case CIT_READ:
@@ -1071,6 +1072,11 @@ static void lov_io_end(const struct lu_env *env, const struct cl_io_slice *ios)
 {
        int rc;
 
+       /* Before ending each i/o, we must set lis_cached_entry to tell the
+        * next i/o not to use stale cached lis information.
+        */
+       cl2lov_io(env, ios)->lis_cached_entry = LIS_CACHE_ENTRY_NONE;
+
        rc = lov_io_call(env, cl2lov_io(env, ios), lov_io_end_wrapper);
        LASSERT(rc == 0);
 }