int rc;
ENTRY;
+ spin_lock(&lfsck->li_lock);
+ lfsck->li_task = current;
+ spin_unlock(&lfsck->li_lock);
+
/* There will be some objects verification during the LFSCK start,
* such as the subsequent lfsck_verify_lpf(). Trigger low layer OI
* OI scrub before that to handle the potential inconsistence. */
current_pid());
spin_lock(&lfsck->li_lock);
+ if (unlikely(!thread_is_starting(thread))) {
+ spin_unlock(&lfsck->li_lock);
+ GOTO(fini_oit, rc = 0);
+ }
+
thread_set_flags(thread, SVC_RUNNING);
spin_unlock(&lfsck->li_lock);
wake_up_all(&thread->t_ctl_waitq);
fini_args:
spin_lock(&lfsck->li_lock);
thread_set_flags(thread, SVC_STOPPED);
+ lfsck->li_task = NULL;
spin_unlock(&lfsck->li_lock);
wake_up_all(&thread->t_ctl_waitq);
lfsck_thread_args_fini(lta);
}
spin_unlock(<ds->ltd_lock);
- rc = ptlrpc_set_wait(set);
+ rc = ptlrpc_set_wait(env, set);
if (rc < 0) {
ptlrpc_set_destroy(set);
RETURN(rc);
up_read(<ds->ltd_rw_sem);
/* Sync up */
- rc = ptlrpc_set_wait(set);
+ rc = ptlrpc_set_wait(env, set);
if (rc < 0) {
ptlrpc_set_destroy(set);
RETURN(rc);
}
spin_unlock(<ds->ltd_lock);
- rc = ptlrpc_set_wait(set);
+ rc = ptlrpc_set_wait(env, set);
if (rc < 0) {
ptlrpc_set_destroy(set);
RETURN(rc);
break;
}
- rc1 = ptlrpc_set_wait(set);
+ rc1 = ptlrpc_set_wait(env, set);
ptlrpc_set_destroy(set);
RETURN(rc != 0 ? rc : rc1);
spin_lock(&lad->lad_lock);
lad->lad_assistant_status = (rc1 != 0 ? rc1 : rc);
thread_set_flags(athread, SVC_STOPPED);
- wake_up_all(&mthread->t_ctl_waitq);
lad->lad_task = NULL;
spin_unlock(&lad->lad_lock);
lad->lad_assistant_status);
lfsck_thread_args_fini(lta);
+ wake_up_all(&mthread->t_ctl_waitq);
return rc;
}