LNIT_NONE = 0,
LNIT_BAD_LINKEA = 1,
LNIT_UNMATCHED_PAIRS = 2,
+ LNIT_DANGLING = 3,
+ LNIT_MUL_REF = 4,
+ LNIT_BAD_TYPE = 5,
+ LNIT_BAD_DIRENT = 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;
/* How many unmatched pairs have been repaired. */
__u64 ln_unmatched_pairs_repaired;
+ /* How many dangling name entries have been found/repaired. */
+ __u64 ln_dangling_repaired;
+
+ /* How many multiple referenced name entries have been
+ * found/repaired. */
+ __u64 ln_mul_ref_repaired;
+
+ /* 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;
+
+ /* 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[29];
+ __u64 ln_reserved[25];
};
enum lfsck_layout_inconsistency_type {
__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 {
struct list_head lar_list;
};
+struct lfsck_namespace_req {
+ struct lfsck_assistant_req lnr_lar;
+ struct dt_object *lnr_obj;
+ struct lu_fid lnr_fid;
+ __u64 lnr_oit_cookie;
+ __u64 lnr_dir_cookie;
+ __u32 lnr_attr;
+ __u32 lnr_size;
+ __u16 lnr_type;
+ __u16 lnr_namelen;
+ char lnr_name[0];
+};
+
struct lfsck_assistant_operations {
int (*la_handler_p1)(const struct lu_env *env,
struct lfsck_component *com,
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;
struct lu_fid lti_fid2;
struct lu_fid lti_fid3;
struct lu_fid lti_fid4;
+ struct lu_fid lti_fid5;
struct lu_attr lti_la;
struct lu_attr lti_la2;
struct lu_attr lti_la3;
struct lfsck_component *com,
struct dt_object *obj,
struct linkea_data *ldata);
+int lfsck_namespace_repair_dangling(const struct lu_env *env,
+ struct lfsck_component *com,
+ struct dt_object *child,
+ struct lfsck_namespace_req *lnr);
+int lfsck_namespace_repair_dirent(const struct lu_env *env,
+ struct lfsck_component *com,
+ struct dt_object *parent,
+ struct dt_object *child,
+ const char *name, const char *name2,
+ __u16 type, bool update, bool dec);
int lfsck_verify_linkea(const struct lu_env *env, struct dt_device *dev,
struct dt_object *obj, const struct lu_name *cname,
const struct lu_fid *pfid);