* GPL HEADER END
*/
/*
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2013, 2014, Intel Corporation.
*/
/*
* lustre/lfsck/lfsck_namespace.c
}
}
- if (rc != 0)
- GOTO(unlock, rc);
-
- rc = dt_attr_set(env, orphan, la, th, BYPASS_CAPA);
+ if (rc == 0)
+ rc = dt_attr_set(env, orphan, la, th, BYPASS_CAPA);
GOTO(stop, rc = (rc == 0 ? 1 : rc));
rc = ptlrpc_queue_wait(req);
ptlrpc_req_finished(req);
- if (rc == 0)
+ if (rc == 0) {
+ orphan->do_lu.lo_header->loh_attr |= LOHA_EXISTS;
rc = 1;
- else if (rc == -EEXIST)
+ } else if (rc == -EEXIST) {
+ orphan->do_lu.lo_header->loh_attr |= LOHA_EXISTS;
rc = 0;
+ }
GOTO(out, rc);
int rc = 0;
ENTRY;
- LASSERT(!dt_object_remote(obj));
-
th = dt_trans_create(env, dev);
if (IS_ERR(th))
GOTO(log, rc = PTR_ERR(th));
struct lfsck_component *com,
struct lu_dirent *ent, __u16 type)
{
- struct lfsck_assistant_data *lad = com->lc_data;
+ struct lfsck_assistant_data *lad = com->lc_data;
+ struct lfsck_instance *lfsck = com->lc_lfsck;
struct lfsck_namespace_req *lnr;
- bool wakeup = false;
+ struct lfsck_bookmark *bk = &lfsck->li_bookmark_ram;
+ struct ptlrpc_thread *mthread = &lfsck->li_thread;
+ struct ptlrpc_thread *athread = &lad->lad_thread;
+ struct l_wait_info lwi = { 0 };
+ bool wakeup = false;
+
+ l_wait_event(mthread->t_ctl_waitq,
+ bk->lb_async_windows == 0 ||
+ lad->lad_prefetched < bk->lb_async_windows ||
+ !thread_is_running(mthread) ||
+ thread_is_stopped(athread),
+ &lwi);
+
+ if (unlikely(!thread_is_running(mthread)) ||
+ thread_is_stopped(athread))
+ return 0;
+
+ if (unlikely(lfsck_is_dead_obj(lfsck->li_obj_dir)))
+ return 0;
lnr = lfsck_namespace_assistant_req_init(com->lc_lfsck, ent, type);
if (IS_ERR(lnr)) {
lfsck->li_time_last_checkpoint;
__u64 checked = ns->ln_items_checked + com->lc_new_checked;
__u64 speed = checked;
- __u64 new_checked = msecs_to_jiffies(com->lc_new_checked *
- MSEC_PER_SEC);
+ __u64 new_checked = com->lc_new_checked *
+ msecs_to_jiffies(MSEC_PER_SEC);
__u32 rtime = ns->ln_run_time_phase1 +
cfs_duration_sec(duration + HALF_SEC);
com->lc_new_checked;
__u64 speed1 = ns->ln_items_checked;
__u64 speed2 = checked;
- __u64 new_checked = msecs_to_jiffies(com->lc_new_checked *
- MSEC_PER_SEC);
+ __u64 new_checked = com->lc_new_checked *
+ msecs_to_jiffies(MSEC_PER_SEC);
__u32 rtime = ns->ln_run_time_phase2 +
cfs_duration_sec(duration + HALF_SEC);