Whamcloud - gitweb
LU-13994 ldlm: osc_object_ast_clear() is called for mdc object on eviction
[fs/lustre-release.git] / lustre / osc / osc_object.c
index f092577..27ef908 100644 (file)
@@ -280,7 +280,7 @@ static int osc_object_fiemap(const struct lu_env *env, struct cl_object *obj,
        mode = ldlm_lock_match(exp->exp_obd->obd_namespace,
                               LDLM_FL_BLOCK_GRANTED | LDLM_FL_LVB_READY,
                               &resid, LDLM_EXTENT, &policy,
-                              LCK_PR | LCK_PW, &lockh, 0);
+                              LCK_PR | LCK_PW, &lockh);
        if (mode) { /* lock is cached on client */
                if (mode != LCK_PR) {
                        ldlm_lock_addref(&lockh, LCK_PR);
@@ -379,7 +379,12 @@ static void osc_req_attr_set(const struct lu_env *env, struct cl_object *obj,
                oa->o_mtime = lvb->lvb_mtime;
                oa->o_valid |= OBD_MD_FLMTIME;
        }
-       if ((flags & OBD_MD_FLATIME) != 0) {
+       /* XXX:
+        * I don't understand this part, what for OSC resets atime just
+        * set by VVP layer to 0 so that OST gets 0 instead of actual
+        * atime, bzzz. please inspect this place with extra care.
+        */
+       if ((flags & OBD_MD_FLATIME) && lvb->lvb_atime > oa->o_atime) {
                oa->o_atime = lvb->lvb_atime;
                oa->o_valid |= OBD_MD_FLATIME;
        }
@@ -491,7 +496,7 @@ int osc_object_invalidate(const struct lu_env *env, struct osc_object *osc)
        osc_lock_discard_pages(env, osc, 0, CL_PAGE_EOF, true);
 
        /* Clear ast data of dlm lock. Do this after discarding all pages */
-       osc_object_prune(env, osc2cl(osc));
+       cl_object_prune(env, osc2cl(osc));
 
        RETURN(0);
 }