When ll_prep_md_op_data() fails, ll_statahead_thread() does not
release reference of sai and parent dentry. It does not wake
up parent thread either. This patch fixes these problems.
Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: Ibcc527d229e8a78710ff2263eb97969c7c46ecdb
Reviewed-on: http://review.whamcloud.com/10940
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
op_data = ll_prep_md_op_data(NULL, dir, dir, NULL, 0, 0,
LUSTRE_OPC_ANY, dir);
if (IS_ERR(op_data))
op_data = ll_prep_md_op_data(NULL, dir, dir, NULL, 0, 0,
LUSTRE_OPC_ANY, dir);
if (IS_ERR(op_data))
- RETURN(PTR_ERR(op_data));
+ GOTO(out_put, rc = PTR_ERR(op_data));
op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages;
op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages;
+ ll_dir_chain_fini(&chain);
ll_finish_md_op_data(op_data);
ll_finish_md_op_data(op_data);
if (sai->sai_agl_valid) {
spin_lock(&plli->lli_agl_lock);
thread_set_flags(agl_thread, SVC_STOPPING);
if (sai->sai_agl_valid) {
spin_lock(&plli->lli_agl_lock);
thread_set_flags(agl_thread, SVC_STOPPING);
/* Set agl_thread flags anyway. */
thread_set_flags(&sai->sai_agl_thread, SVC_STOPPED);
}
/* Set agl_thread flags anyway. */
thread_set_flags(&sai->sai_agl_thread, SVC_STOPPED);
}
- ll_dir_chain_fini(&chain);
spin_lock(&plli->lli_sa_lock);
if (!sa_received_empty(sai)) {
thread_set_flags(thread, SVC_STOPPING);
spin_lock(&plli->lli_sa_lock);
if (!sa_received_empty(sai)) {
thread_set_flags(thread, SVC_STOPPING);
wake_up(&sai->sai_waitq);
wake_up(&thread->t_ctl_waitq);
ll_sai_put(sai);
wake_up(&sai->sai_waitq);
wake_up(&thread->t_ctl_waitq);
ll_sai_put(sai);
CDEBUG(D_READA, "statahead thread stopped: sai %p, parent %.*s\n",
sai, parent->d_name.len, parent->d_name.name);
CDEBUG(D_READA, "statahead thread stopped: sai %p, parent %.*s\n",
sai, parent->d_name.len, parent->d_name.name);