trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sor...@apache.org
Subject [06/11] git commit: TS-1475 - check to end loop if disks_left==0; shouldn't happen
Date Mon, 14 Jul 2014 18:10:21 GMT
TS-1475 - check to end loop if disks_left==0; shouldn't happen


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/5cdcb98b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/5cdcb98b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/5cdcb98b

Branch: refs/heads/master
Commit: 5cdcb98b23a103aa590fbc394d8f1fb276bcfa59
Parents: bdcb06a
Author: Justin Laue <justin@fp-x.com>
Authored: Mon Jul 14 10:45:32 2014 -0600
Committer: Phil Sorber <sorber@apache.org>
Committed: Mon Jul 14 12:09:57 2014 -0600

----------------------------------------------------------------------
 iocore/cache/Store.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5cdcb98b/iocore/cache/Store.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Store.cc b/iocore/cache/Store.cc
index 788ad11..e1d850f 100644
--- a/iocore/cache/Store.cc
+++ b/iocore/cache/Store.cc
@@ -909,7 +909,7 @@ Store::spread_alloc(Store & s, unsigned int blocks, bool mmapable)
 
   int disks_left = spread_over;
 
-  for (unsigned i = 0; blocks && i < n_disks; i++) {
+  for (unsigned i = 0; blocks && disks_left && i < n_disks; i++) {
     if (!(mmapable && !disk[i]->is_mmapable())) {
       unsigned int target = blocks / disks_left;
       if (blocks - target > total_blocks(i + 1))


Mime
View raw message