dm raid: cleanup awkward branching in raid_message() option processing
authorMike Snitzer <snitzer@redhat.com>
Fri, 6 Jan 2017 20:38:08 +0000 (15:38 -0500)
committerMike Snitzer <snitzer@redhat.com>
Wed, 25 Jan 2017 11:49:07 +0000 (12:49 +0100)
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-raid.c

index 34442c66bbf19858e38fd1882805a9be960444a9..5c9e95d66f3b64d14355a91abd936eb5f3c46440 100644 (file)
@@ -3464,10 +3464,11 @@ static int raid_message(struct dm_target *ti, unsigned int argc, char **argv)
        else {
                if (!strcasecmp(argv[0], "check"))
                        set_bit(MD_RECOVERY_CHECK, &mddev->recovery);
-               else if (!!strcasecmp(argv[0], "repair"))
+               else if (!strcasecmp(argv[0], "repair")) {
+                       set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery);
+                       set_bit(MD_RECOVERY_SYNC, &mddev->recovery);
+               } else
                        return -EINVAL;
-               set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery);
-               set_bit(MD_RECOVERY_SYNC, &mddev->recovery);
        }
        if (mddev->ro == 2) {
                /* A write to sync_action is enough to justify