Whamcloud - gitweb
LU-10496 ofd: serialize fmd check and set
[fs/lustre-release.git] / lustre / ofd / ofd_objects.c
index e98e72b..4c76972 100644 (file)
@@ -664,10 +664,6 @@ int ofd_attr_set(const struct lu_env *env, struct ofd_object *fo,
        if (!ofd_object_exists(fo))
                GOTO(out, rc = -ENOENT);
 
-       if (la->la_valid & (LA_ATIME | LA_MTIME | LA_CTIME))
-               tgt_fmd_update(info->fti_exp, &fo->ofo_header.loh_fid,
-                              info->fti_xid);
-
        /* VBR: version recovery check */
        rc = ofd_version_get_check(info, fo);
        if (rc)
@@ -700,6 +696,11 @@ int ofd_attr_set(const struct lu_env *env, struct ofd_object *fo,
        if (!ofd_object_exists(fo))
                GOTO(unlock, rc = -ENOENT);
 
+       /* serialize vs ofd_commitrw_write() */
+       if (la->la_valid & (LA_ATIME | LA_MTIME | LA_CTIME))
+               tgt_fmd_update(info->fti_exp, &fo->ofo_header.loh_fid,
+                              info->fti_xid);
+
        rc = dt_attr_set(env, ofd_object_child(fo), la, th);
        if (rc)
                GOTO(unlock, rc);