X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Fofd%2Fofd_objects.c;h=39179690aa55a12dd858da77ee065db8ff5f5292;hb=0209add4a5099817111c8576afe930d1e2daef03;hp=cd8c26a25db5be7e7dbd6aa0608729b50ba7e9cb;hpb=e1245db78d4de34d5e3236edbfb5b2b0eec638a0;p=fs%2Flustre-release.git diff --git a/lustre/ofd/ofd_objects.c b/lustre/ofd/ofd_objects.c index cd8c26a..3917969 100644 --- a/lustre/ofd/ofd_objects.c +++ b/lustre/ofd/ofd_objects.c @@ -43,6 +43,7 @@ #include #include +#include #include "ofd_internal.h" @@ -231,7 +232,7 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd, 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); @@ -270,7 +271,7 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd, /* 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. @@ -295,7 +296,16 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd, 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);