From: Niu Yawei Date: Mon, 30 May 2011 06:30:06 +0000 (-0700) Subject: LU-369 assert(t_watchdog) failed in quota_chk_acq_common() X-Git-Tag: 2.0.66.0~18 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=d57911ad26ee6ae39738d7ed36898a915290a51f LU-369 assert(t_watchdog) failed in quota_chk_acq_common() Remove the incorrect assert(t_watchdog) in quota_chk_acq_common() and schedule_dqacq(), since they might be called from recovery thread, which doesn't have t_watchdog attached. Signed-off-by: Niu Yawei Change-Id: I22e65c66827811309e43910e9a4d34251aad99c3 Reviewed-on: http://review.whamcloud.com/870 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Johann Lombardi Reviewed-by: Oleg Drokin --- diff --git a/lustre/quota/quota_context.c b/lustre/quota/quota_context.c index af31518..b1149e0 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -1040,17 +1040,19 @@ schedule_dqacq(struct obd_device *obd, struct lustre_quota_ctxt *qctxt, cfs_spin_lock(&qctxt->lqc_lock); if (wait && !qctxt->lqc_import) { cfs_spin_unlock(&qctxt->lqc_lock); - - LASSERT(oti && oti->oti_thread && - oti->oti_thread->t_watchdog); - - lc_watchdog_disable(oti->oti_thread->t_watchdog); + LASSERT(oti && oti->oti_thread); + /* The recovery thread doesn't have watchdog + * attached. LU-369 */ + if (oti->oti_thread->t_watchdog) + lc_watchdog_disable(oti->oti_thread->\ + t_watchdog); CDEBUG(D_QUOTA, "sleep for quota master\n"); l_wait_event(qctxt->lqc_wait_for_qmaster, check_qm(qctxt), &lwi); CDEBUG(D_QUOTA, "wake up when quota master is back\n"); - lc_watchdog_touch(oti->oti_thread->t_watchdog, - CFS_GET_TIMEOUT(oti->oti_thread->t_svc)); + if (oti->oti_thread->t_watchdog) + lc_watchdog_touch(oti->oti_thread->t_watchdog, + CFS_GET_TIMEOUT(oti->oti_thread->t_svc)); } else { cfs_spin_unlock(&qctxt->lqc_lock); } diff --git a/lustre/quota/quota_interface.c b/lustre/quota/quota_interface.c index 87c14cf..5b3057c 100644 --- a/lustre/quota/quota_interface.c +++ b/lustre/quota/quota_interface.c @@ -446,17 +446,19 @@ static int quota_chk_acq_common(struct obd_device *obd, struct obd_export *exp, cfs_spin_lock(&qctxt->lqc_lock); if (!qctxt->lqc_import && oti) { cfs_spin_unlock(&qctxt->lqc_lock); - - LASSERT(oti && oti->oti_thread && - oti->oti_thread->t_watchdog); - - lc_watchdog_disable(oti->oti_thread->t_watchdog); + LASSERT(oti->oti_thread); + /* The recovery thread doesn't have watchdog + * attached. LU-369 */ + if (oti->oti_thread->t_watchdog) + lc_watchdog_disable(oti->oti_thread->\ + t_watchdog); CDEBUG(D_QUOTA, "sleep for quota master\n"); l_wait_event(qctxt->lqc_wait_for_qmaster, check_qm(qctxt), &lwi); CDEBUG(D_QUOTA, "wake up when quota master is back\n"); - lc_watchdog_touch(oti->oti_thread->t_watchdog, - CFS_GET_TIMEOUT(oti->oti_thread->t_svc)); + if (oti->oti_thread->t_watchdog) + lc_watchdog_touch(oti->oti_thread->t_watchdog, + CFS_GET_TIMEOUT(oti->oti_thread->t_svc)); } else { cfs_spin_unlock(&qctxt->lqc_lock); }