Whamcloud - gitweb
Branch b1_8_gate
authortianzy <tianzy>
Wed, 26 Nov 2008 08:23:33 +0000 (08:23 +0000)
committertianzy <tianzy>
Wed, 26 Nov 2008 08:23:33 +0000 (08:23 +0000)
fix the false qunit_put in qctxt_wait_pending_dqacq()
b=17794
i=tianzy
i=panda

lustre/quota/quota_context.c

index 47bdf55..6a886fa 100644 (file)
@@ -1039,13 +1039,6 @@ qctxt_wait_pending_dqacq(struct lustre_quota_ctxt *qctxt, unsigned int id,
                 l_wait_event(qunit->lq_waitq, got_qunit(qunit), &lwi);
                 CDEBUG(D_QUOTA, "qunit(%p) finishes waiting. (rc:%d)\n",
                        qunit, qunit->lq_rc);
-                qunit_put(qunit);
-                do_gettimeofday(&work_end);
-                timediff = cfs_timeval_sub(&work_end, &work_start, NULL);
-                lprocfs_counter_add(qctxt->lqc_stats,
-                                    isblk ? LQUOTA_WAIT_PENDING_BLK_QUOTA :
-                                            LQUOTA_WAIT_PENDING_INO_QUOTA,
-                                    timediff);
                 /* keep same as schedule_dqacq() b=17030 */
                 spin_lock(&qunit->lq_lock);
                 if (qunit->lq_rc == 0)
@@ -1053,6 +1046,13 @@ qctxt_wait_pending_dqacq(struct lustre_quota_ctxt *qctxt, unsigned int id,
                 else
                         rc = qunit->lq_rc;
                 spin_unlock(&qunit->lq_lock);
+                qunit_put(qunit);
+                do_gettimeofday(&work_end);
+                timediff = cfs_timeval_sub(&work_end, &work_start, NULL);
+                lprocfs_counter_add(qctxt->lqc_stats,
+                                    isblk ? LQUOTA_WAIT_PENDING_BLK_QUOTA :
+                                            LQUOTA_WAIT_PENDING_INO_QUOTA,
+                                    timediff);
         } else {
                 do_gettimeofday(&work_end);
                 timediff = cfs_timeval_sub(&work_end, &work_start, NULL);