X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Flfsck%2Flfsck_internal.h;h=1ce764e0d26f74713b179510c3e2ed4e92c9cab1;hp=12b648d4e4714ab2bc2404f5550c2b3740c2157b;hb=ad6dd123cc475e8babcc1b8698fc4d1963841832;hpb=901f5186323eb6df71921bd093aa60d37cde77be diff --git a/lustre/lfsck/lfsck_internal.h b/lustre/lfsck/lfsck_internal.h index 12b648d..1ce764e 100644 --- a/lustre/lfsck/lfsck_internal.h +++ b/lustre/lfsck/lfsck_internal.h @@ -111,6 +111,8 @@ struct lfsck_bookmark { enum lfsck_namespace_trace_flags { LNTF_CHECK_LINKEA = 0x01, LNTF_CHECK_PARENT = 0x02, + LNTF_SKIP_NLINK = 0x04, + LNTF_CHECK_ORPHAN = 0x08, LNTF_ALL = 0xff }; @@ -185,9 +187,6 @@ struct lfsck_namespace { /* How many objects with nlink fixed. */ __u64 ln_objs_nlink_repaired; - /* How many objects were lost before, but found back now. */ - __u64 ln_objs_lost_found; - /* The latest object has been processed (failed) during double scan. */ struct lu_fid ln_fid_latest_scanned_phase2; @@ -219,8 +218,29 @@ struct lfsck_namespace { /* How many name entries with bad file type have been repaired. */ __u64 ln_bad_type_repaired; + /* How many lost name entries have been re-inserted. */ + __u64 ln_lost_dirent_repaired; + + /* How many objects under /lost+found have been scanned. */ + __u64 ln_local_lpf_scanned; + + /* How many objects under /lost+found have been moved to + * namespace visible directory. */ + __u64 ln_local_lpf_moved; + + /* How many objects under /lost+found have been skipped. */ + __u64 ln_local_lpf_skipped; + + /* How many objects under /lost+found failed to be processed. */ + __u64 ln_local_lpf_failed; + + /* The size of MDT targets bitmap with nbits. Such bitmap records + * the MDTs that contain non-verified MDT-objects. */ + __u32 ln_bitmap_size; + + __u32 ln_reserved_1; /* For further using. 256-bytes aligned now. */ - __u64 ln_reserved[26]; + __u64 ln_reserved[25]; }; enum lfsck_layout_inconsistency_type { @@ -354,7 +374,8 @@ struct lfsck_operations { int (*lfsck_in_notify)(const struct lu_env *env, struct lfsck_component *com, - struct lfsck_request *lr); + struct lfsck_request *lr, + struct thandle *th); int (*lfsck_query)(const struct lu_env *env, struct lfsck_component *com); @@ -382,7 +403,8 @@ struct lfsck_tgt_desc { __u32 ltd_namespace_gen; unsigned int ltd_dead:1, ltd_layout_done:1, - ltd_namespace_done:1; + ltd_namespace_done:1, + ltd_namespace_failed:1; }; struct lfsck_tgt_desc_idx { @@ -652,6 +674,7 @@ struct lfsck_assistant_data { struct lfsck_thread_info { struct lu_name lti_name_const; struct lu_name lti_name; + struct lu_name lti_name2; struct lu_buf lti_buf; struct lu_buf lti_linkea_buf; struct lu_buf lti_linkea_buf2; @@ -748,6 +771,7 @@ void lfsck_quit_generic(const struct lu_env *env, struct lfsck_component *com); /* lfsck_engine.c */ +int lfsck_unpack_ent(struct lu_dirent *ent, __u64 *cookie, __u16 *type); int lfsck_master_engine(void *args); int lfsck_assistant_engine(void *args); @@ -1097,11 +1121,15 @@ static inline void lfsck_lad_set_bitmap(const struct lu_env *env, LASSERT(com->lc_lfsck->li_master); LASSERT(bitmap != NULL); - LASSERTF(bitmap->size > index, "invalid index: nbits %d, index %u\n", - bitmap->size, index); - cfs_bitmap_set(bitmap, index); - lad->lad_incomplete = 1; + if (likely(bitmap->size > index)) { + cfs_bitmap_set(bitmap, index); + lad->lad_incomplete = 1; + } else if (com->lc_type == LFSCK_TYPE_NAMESPACE) { + struct lfsck_namespace *ns = com->lc_file_ram; + + ns->ln_flags |= LF_INCOMPLETE; + } } static inline int lfsck_links_read(const struct lu_env *env,