1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

raid: fix the string compare

Coverity noticed this condition is always false and the error
path could never be visited.

So check for all mismatches of supported messages
and actually mark log_error as internal error.
This commit is contained in:
Zdenek Kabelac 2015-11-10 21:32:46 +01:00
parent 59905100d1
commit a45cc0fe14

View File

@ -1410,14 +1410,14 @@ int dev_manager_raid_message(struct dev_manager *dm,
}
/* These are the supported RAID messages for dm-raid v1.5.0 */
if (!strcmp(msg, "idle") &&
!strcmp(msg, "frozen") &&
!strcmp(msg, "resync") &&
!strcmp(msg, "recover") &&
!strcmp(msg, "check") &&
!strcmp(msg, "repair") &&
!strcmp(msg, "reshape")) {
log_error("Unknown RAID message: %s", msg);
if (strcmp(msg, "idle") &&
strcmp(msg, "frozen") &&
strcmp(msg, "resync") &&
strcmp(msg, "recover") &&
strcmp(msg, "check") &&
strcmp(msg, "repair") &&
strcmp(msg, "reshape")) {
log_error(INTERNAL_ERROR "Unknown RAID message: %s", msg);
return 0;
}