*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*
* lustre/ofd/ofd_lvb.c
*
return 0;
}
+static bool ofd_resync_allowed(struct ofd_device *ofd)
+{
+ struct obd_device *obd = ofd_obd(ofd);
+
+ if (obd->obd_recovery_start == 0)
+ return false;
+
+ if (obd->obd_recovery_start + obd->obd_recovery_time_hard <
+ ktime_get_seconds())
+ return false;
+
+ return true;
+}
+
/**
* Implementation of ldlm_valblock_ops::lvbo_init for OFD.
*
ofd = ldlm_res_to_ns(res)->ns_lvbp;
LASSERT(ofd != NULL);
- if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_OST_LVB))
+ if (CFS_FAIL_CHECK(OBD_FAIL_LDLM_OST_LVB))
RETURN(-ENOMEM);
env = lu_env_find();
oseq = ofd_seq_load(env, ofd, fid_seq_is_idif(seq) ?
FID_SEQ_OST_MDT0 : seq);
if (!IS_ERR_OR_NULL(oseq)) {
- if (!oseq->os_last_id_synced)
- rc = -EAGAIN;
+ if (!oseq->os_last_id_synced &&
+ ofd_resync_allowed(ofd))
+ rc = -EINPROGRESS;
ofd_seq_put(env, oseq);
}
}
lvb->lvb_atime = info->fti_attr.la_atime;
lvb->lvb_ctime = info->fti_attr.la_ctime;
- CDEBUG(D_DLMTRACE, "res: "DFID" initial lvb size: %llu, "
- "mtime: %#llx, blocks: %#llx\n",
- PFID(&info->fti_fid), lvb->lvb_size,
- lvb->lvb_mtime, lvb->lvb_blocks);
+ if (fo->ofo_atime_ondisk == 0)
+ fo->ofo_atime_ondisk = info->fti_attr.la_atime;
+
+ CDEBUG(D_DLMTRACE,
+ "res: "DFID" initial LVB size: %llu, mtime: %#llx, atime: %#llx, ctime: %#llx, blocks: %#llx\n",
+ PFID(&info->fti_fid), lvb->lvb_size, lvb->lvb_mtime,
+ lvb->lvb_atime, lvb->lvb_ctime, lvb->lvb_blocks);
info->fti_attr.la_valid = 0;