From 70a93acdceafbceadedd778fbafc3ee76093f4ab Mon Sep 17 00:00:00 2001
From: liuy <liuy>
Date: Thu, 6 Sep 2007 08:15:28 +0000
Subject: [PATCH] Branch HEAD b=13125 i=nathan, deen

Description: osts not allocated evenly to files
Details    : change the condition to increase offset_idx
---
 lustre/ChangeLog     | 6 ++++++
 lustre/lov/lov_qos.c | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index 9e11a86f3c..5b6a32dbaf 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -214,6 +214,12 @@ Description: when mds and osts use different quota unit(32bit and 64bit),
              quota will be released repeatly.
 Details    : void sending multiple quota reqs to mds, which will keep the status 
              between the reqs.
+
+Severity   : normal 
+Bugzilla   : 13125
+Description: osts not allocated evenly to files
+Details    : change the condition to increase offset_idx 
+
 --------------------------------------------------------------------------------
 
 2007-08-10         Cluster File Systems, Inc. <info@clusterfs.com>
diff --git a/lustre/lov/lov_qos.c b/lustre/lov/lov_qos.c
index 866d2602d6..c6ff1ebd46 100644
--- a/lustre/lov/lov_qos.c
+++ b/lustre/lov/lov_qos.c
@@ -532,7 +532,9 @@ static int alloc_rr(struct lov_obd *lov, int *idx_arr, int *stripe_cnt,
                 /* If we have allocated from all of the OSTs, slowly
                    precess the next start */
                 lov->lov_start_idx %= ost_count;
-                ++lov->lov_offset_idx;
+                if (stripe_cnt_min > 1 &&
+                    (ost_active_count % stripe_cnt_min) != 1)
+                        ++lov->lov_offset_idx;
         }
         down_read(&lov->lov_qos.lq_rw_sem);
         ost_start_idx_temp = lov->lov_start_idx;
-- 
GitLab