#include <dt_object.h>
#include <lustre/lustre_idl.h>
+#include <lustre_lfsck.h>
#include "ofd_internal.h"
th->th_sync |= sync;
- rc = dt_declare_record_write(env, oseq->os_lastid_obj, sizeof(tmp),
+ rc = dt_declare_record_write(env, oseq->os_lastid_obj, &info->fti_buf,
info->fti_off, th);
if (rc)
GOTO(trans_stop, rc);
/* When the LFSCK scanning the whole device to verify the LAST_ID file
* consistency, it will load the last_id into RAM firstly, and compare
- * the last_id with echo OST-object's ID. If the later one is larger,
+ * the last_id with each OST-object's ID. If the later one is larger,
* then it will regard the LAST_ID file crashed. But during the LFSCK
* scanning, the OFD may continue to create new OST-objects. Those new
* created OST-objects will have larger IDs than the LFSCK known ones.
fo = batch[i];
LASSERT(fo);
- if (likely(!ofd_object_exists(fo))) {
+ /* Only the new created objects need to be recorded. */
+ if (ofd->ofd_osd->dd_record_fid_accessed) {
+ lfsck_pack_rfa(&ofd_info(env)->fti_lr,
+ lu_object_fid(&fo->ofo_obj.do_lu));
+ lfsck_in_notify(env, ofd->ofd_osd,
+ &ofd_info(env)->fti_lr);
+ }
+
+ if (likely(!ofd_object_exists(fo) &&
+ !OBD_FAIL_CHECK(OBD_FAIL_LFSCK_DANGLING))) {
next = ofd_object_child(fo);
LASSERT(next != NULL);