NULL,
"failout",
"dryrun",
+ "all_targets",
NULL
};
LASSERT(list_empty(&lfsck->li_link));
LASSERT(thread_is_init(thread) || thread_is_stopped(thread));
- lfsck_tgt_descs_fini(&lfsck->li_ost_descs);
- lfsck_tgt_descs_fini(&lfsck->li_mdt_descs);
-
if (lfsck->li_obj_oit != NULL) {
lu_object_put_nocache(env, &lfsck->li_obj_oit->do_lu);
lfsck->li_obj_oit = NULL;
lfsck_component_cleanup(env, com);
}
+ lfsck_tgt_descs_fini(&lfsck->li_ost_descs);
+ lfsck_tgt_descs_fini(&lfsck->li_mdt_descs);
+
if (lfsck->li_bookmark_obj != NULL) {
lu_object_put_nocache(env, &lfsck->li_bookmark_obj->do_lu);
lfsck->li_bookmark_obj = NULL;
}
struct lfsck_thread_args *lfsck_thread_args_init(struct lfsck_instance *lfsck,
- struct lfsck_component *com)
+ struct lfsck_component *com,
+ struct lfsck_start_param *lsp)
{
struct lfsck_thread_args *lta;
int rc;
if (com != NULL)
lta->lta_com = lfsck_component_get(com);
+ lta->lta_lsp = lsp;
+
return lta;
}
return rc1 != 0 ? rc1 : rc;
}
-int lfsck_prep(const struct lu_env *env, struct lfsck_instance *lfsck)
+int lfsck_prep(const struct lu_env *env, struct lfsck_instance *lfsck,
+ struct lfsck_start_param *lsp)
{
struct dt_object *obj = NULL;
struct lfsck_component *com;
if (lfsck->li_bookmark_ram.lb_param & LPF_DRYRUN)
com->lc_journal = 0;
- rc = com->lc_ops->lfsck_prep(env, com);
+ rc = com->lc_ops->lfsck_prep(env, com, lsp);
if (rc != 0)
GOTO(out, rc);
laia = ptlrpc_req_async_args(req);
*laia = *(struct lfsck_async_interpret_args *)args;
+ lfsck_component_get(laia->laia_com);
req->rq_interpret_reply = interpreter;
ptlrpc_set_add_req(set, req);
if (!thread_is_init(thread) && !thread_is_stopped(thread)) {
rc = -EALREADY;
while (start->ls_active != 0) {
- if (type & start->ls_active) {
+ if (!(type & start->ls_active)) {
+ type <<= 1;
+ continue;
+ }
+
+ com = __lfsck_component_find(lfsck, type,
+ &lfsck->li_list_scan);
+ if (com == NULL)
com = __lfsck_component_find(lfsck, type,
- &lfsck->li_list_scan);
- if (com == NULL)
- com = __lfsck_component_find(lfsck,
- type,
&lfsck->li_list_double_scan);
- if (com == NULL) {
- rc = -EBUSY;
+ if (com == NULL) {
+ rc = -EOPNOTSUPP;
+ break;
+ }
+
+ if (com->lc_ops->lfsck_join != NULL) {
+ rc = com->lc_ops->lfsck_join( env, com, lsp);
+ if (rc != 0 && rc != -EALREADY)
break;
- } else {
- start->ls_active &= ~type;
- }
}
+ start->ls_active &= ~type;
type <<= 1;
}
spin_unlock(&lfsck->li_lock);
}
}
+ if (bk->lb_param & LPF_ALL_MDT &&
+ !(start->ls_flags & LPF_ALL_MDT)) {
+ bk->lb_param &= ~LPF_ALL_MDT;
+ dirty = true;
+ } else if (!(bk->lb_param & LPF_ALL_MDT) &&
+ start->ls_flags & LPF_ALL_MDT) {
+ bk->lb_param |= LPF_ALL_MDT;
+ dirty = true;
+ }
+
if (dirty) {
rc = lfsck_bookmark_store(env, lfsck);
if (rc != 0)
lfsck->li_args_oit = (flags << DT_OTABLE_IT_FLAGS_SHIFT) | valid;
thread_set_flags(thread, 0);
- lta = lfsck_thread_args_init(lfsck, NULL);
+ lta = lfsck_thread_args_init(lfsck, NULL, lsp);
if (IS_ERR(lta))
GOTO(out, rc = PTR_ERR(lta));
GOTO(out, rc = -EALREADY);
}
- if (stop != NULL)
+ if (stop != NULL) {
lfsck->li_status = stop->ls_status;
- else
+ lfsck->li_flags = stop->ls_flags;
+ } else {
lfsck->li_status = LS_STOPPED;
+ lfsck->li_flags = 0;
+ }
thread_set_flags(thread, SVC_STOPPING);
spin_unlock(&lfsck->li_lock);
EXPORT_SYMBOL(lfsck_query);
int lfsck_register(const struct lu_env *env, struct dt_device *key,
- struct dt_device *next, lfsck_out_notify notify,
- void *notify_data, bool master)
+ struct dt_device *next, struct obd_device *obd,
+ lfsck_out_notify notify, void *notify_data, bool master)
{
struct lfsck_instance *lfsck;
struct dt_object *root = NULL;
lfsck->li_out_notify_data = notify_data;
lfsck->li_next = next;
lfsck->li_bottom = key;
+ lfsck->li_obd = obd;
rc = lfsck_tgt_descs_init(&lfsck->li_ost_descs);
if (rc != 0)
spin_lock(<ds->ltd_lock);
ltd->ltd_dead = 1;
if (!list_empty(<d->ltd_layout_list)) {
+ list_del_init(<d->ltd_layout_phase_list);
list_del_init(<d->ltd_layout_list);
stop = true;
} else {