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.
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.