ClusterLabs / resource-agents

Combined repository of OCF agents from the RHCS and Linux-HA projects
GNU General Public License v2.0
493 stars 581 forks source link

storage_mon: Fix bug in checking of number of specified scores. #1792

Closed MasaoFujii closed 2 years ago

MasaoFujii commented 2 years ago

Previously specifying the maximum allowed number (MAX_DEVICES, currently 25) of devices and scores as arguments could cause storage_mon to fail unexpectedly with the error message "too many scores, max is 25". This issue happened because storage_mon checked whether the number of specified scores exceeded the upper limit by using the local variable "device_count" indicating the number of specified devices (not scores). So after the maximum number of devices arguments were interpreted, the appearance of next score argument caused the error even when the number of interpreted scores arguments had not exceeded the maximum.

This patch fixes storage_mon so that it uses the local variable "score_count" indicating the number of specified scores, to check whether arguments for scores are specified more than the upper limit.

knet-ci-bot commented 2 years ago

Can one of the admins verify this patch?

oalbrigt commented 2 years ago

ok to test

oalbrigt commented 2 years ago

Thanks.