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 <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8939
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
Pranith Kumar K 2014-10-17 11:46:46 +05:30 committed by Vijay Bellur
parent 5ac067e560
commit eea8066462

View File

@ -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",