Whamcloud - gitweb
Branch b1_8_gate
authorjohann <johann>
Mon, 29 Sep 2008 16:12:25 +0000 (16:12 +0000)
committerjohann <johann>
Mon, 29 Sep 2008 16:12:25 +0000 (16:12 +0000)
b=17030
i=johann (original patch from Tianzy)
i=andrew

qctxt_wait_pending_dqacq() must return the same value as schedule_dqacq()
otherwise ost threads can be stuck in got_qunit() for a long time,
causing a watchdog storm during failover.

lustre/quota/quota_context.c

index c974530..0d95970 100644 (file)
@@ -1014,6 +1014,7 @@ qctxt_wait_pending_dqacq(struct lustre_quota_ctxt *qctxt, unsigned int id,
         struct timeval work_end;
         long timediff;
         struct l_wait_info lwi = { 0 };
+        int rc = 0;
         ENTRY;
 
         do_gettimeofday(&work_start);
@@ -1046,6 +1047,13 @@ qctxt_wait_pending_dqacq(struct lustre_quota_ctxt *qctxt, unsigned int id,
                                     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)
+                        rc = -EAGAIN;
+                else
+                        rc = qunit->lq_rc;
+                spin_unlock(&qunit->lq_lock);
         } else {
                 do_gettimeofday(&work_end);
                 timediff = cfs_timeval_sub(&work_end, &work_start, NULL);
@@ -1055,7 +1063,7 @@ qctxt_wait_pending_dqacq(struct lustre_quota_ctxt *qctxt, unsigned int id,
                                     timediff);
         }
 
-        RETURN(0);
+        RETURN(rc);
 }
 
 int