From eea806646216f5e5a91fd35a4e138e193e3b6fac Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 17 Oct 2014 11:46:46 +0530 Subject: performance/io-threads: Fix static analysis error stub->fop can be more than FOP_MAX is what static analysis is complaining. This patch doesn't allow any 'log' to be printed in the case fop value is not in the definied range. It gives EINVAL instead. Change-Id: I293381e2c1ad0ab45154b0192a637612becaf744 BUG: 1153935 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/8939 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/performance/io-threads/src/io-threads.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'xlators/performance') diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 8201a95a4d0..9c6ae5af12e 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -336,15 +336,13 @@ iot_schedule (call_frame_t *frame, xlator_t *this, call_stub_t *stub) pri = IOT_PRI_LO; break; - case GF_FOP_NULL: case GF_FOP_FORGET: case GF_FOP_RELEASE: case GF_FOP_RELEASEDIR: case GF_FOP_GETSPEC: - case GF_FOP_MAXVALUE: - //fail compilation on missing fop - //new fop must choose priority. break; + default: + return -EINVAL; } out: gf_log (this->name, GF_LOG_DEBUG, "%s scheduled as %s fop", -- cgit