]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/TrackedOp: break out of loop when reaching log threshold
authorZhiqiang Wang <zhiqiang.wang@intel.com>
Fri, 27 Mar 2015 08:06:26 +0000 (16:06 +0800)
committerZhiqiang Wang <zhiqiang.wang@intel.com>
Thu, 11 Jun 2015 08:10:53 +0000 (16:10 +0800)
When the number of warned ops reaches the log threshold, should break
out of the outer for loop as well.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
src/common/TrackedOp.cc

index 32dbc5398dcc20ff23634354e13afac1fa611a78..727811a979d581846e6d2b1521b8319bb054489e 100644 (file)
@@ -191,7 +191,8 @@ bool OpTracker::check_ops_in_flight(std::vector<string> &warning_vector)
 
   int slow = 0;     // total slow
   int warned = 0;   // total logged
-  for (uint32_t iter = 0; iter < num_optracker_shards; iter++) {
+  for (uint32_t iter = 0;
+       iter < num_optracker_shards && warned < log_threshold; iter++) {
     ShardedTrackingData* sdata = sharded_in_flight_list[iter];
     assert(NULL != sdata);
     Mutex::Locker locker(sdata->ops_in_flight_lock_sharded);