- /* If the file has not been changed for some time, we return
- * not only a LOOKUP lock, but also an UPDATE lock and this
- * might save us RPC on later STAT. For directories, it also
- * let negative dentry starts working for this dir. */
- if (ma->ma_valid & MA_INODE &&
- ma->ma_attr.la_valid & LA_CTIME &&
- info->mti_mdt->mdt_namespace->ns_ctime_age_limit +
- ma->ma_attr.la_ctime < cfs_time_current_sec())
- child_bits |= MDS_INODELOCK_UPDATE;
+ ma->ma_valid = 0;
+ ma->ma_need = MA_INODE;
+ rc = mo_attr_get(info->mti_env,
+ mdt_object_child(child), ma);
+ if (unlikely(rc != 0))
+ GOTO(out_child, rc);
+
+ /* If the file has not been changed for some time, we
+ * return not only a LOOKUP lock, but also an UPDATE
+ * lock and this might save us RPC on later STAT. For
+ * directories, it also let negative dentry starts
+ * working for this dir. */
+ if (ma->ma_valid & MA_INODE &&
+ ma->ma_attr.la_valid & LA_CTIME &&
+ info->mti_mdt->mdt_namespace->ns_ctime_age_limit +
+ ma->ma_attr.la_ctime < cfs_time_current_sec())
+ child_bits |= MDS_INODELOCK_UPDATE;
+ }