From 67ed26a4eaf80d91fe2adeea0782e12609513938 Mon Sep 17 00:00:00 2001 From: Prateek Pandey Date: Thu, 7 Mar 2019 16:10:19 +0530 Subject: [PATCH] fix(tunings): set default Luworkers in case of invalid ENV value (#237) Signed-off-by: prateekpandey14 --- src/istgt_lu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/istgt_lu.c b/src/istgt_lu.c index 4da87915..399376e2 100644 --- a/src/istgt_lu.c +++ b/src/istgt_lu.c @@ -1390,7 +1390,7 @@ static void set_queue_depth(CF_SECTION *sp, ISTGT_LU_Ptr lu) } else { lu->queue_depth = (int) strtol(val, NULL, 10); } - if (lu->queue_depth < 0 || lu->queue_depth >= MAX_LU_QUEUE_DEPTH) { + if (lu->queue_depth < 1 || lu->queue_depth >= MAX_LU_QUEUE_DEPTH) { ISTGT_ERRLOG("LU%d: queue depth %d is not in range, resetting to %d\n", lu->num, lu->queue_depth, DEFAULT_LU_QUEUE_DEPTH); lu->queue_depth = DEFAULT_LU_QUEUE_DEPTH; } @@ -1423,7 +1423,7 @@ static void set_luworkers(CF_SECTION *sp, ISTGT_LU_Ptr lu) } else if (lu->luworkers < 1) { ISTGT_ERRLOG("LU%d: luworkers %d is not in range, resetting to %d\n", lu->num, lu->luworkers, 1); - lu->luworkers = 1; + lu->luworkers = ISTGT_NUM_LUWORKERS_DEFAULT; } } }