summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/syncop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index e407ab74d6f..da0444a109a 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -357,7 +357,7 @@ syncenv_scale (struct syncenv *env)
if (env->procs > env->runcount)
goto unlock;
- thmax = max (env->runcount, SYNCENV_PROC_MAX);
+ thmax = min (env->runcount, SYNCENV_PROC_MAX);
for (i = env->procs; i < thmax; i++) {
env->proc[i].env = env;
ret = pthread_create (&env->proc[i].processor, NULL,