dm: flakey fix corrupt_bio_byte error path

If no arguments were provided to the corrupt_bio_byte feature an error
should be returned immediately.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
Mike Snitzer 2011-09-25 23:26:15 +01:00 коммит произвёл Alasdair G Kergon
Родитель d93dc5c447
Коммит 68e58a294f
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -81,8 +81,10 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc,
* corrupt_bio_byte <Nth_byte> <direction> <value> <bio_flags> * corrupt_bio_byte <Nth_byte> <direction> <value> <bio_flags>
*/ */
if (!strcasecmp(arg_name, "corrupt_bio_byte")) { if (!strcasecmp(arg_name, "corrupt_bio_byte")) {
if (!argc) if (!argc) {
ti->error = "Feature corrupt_bio_byte requires parameters"; ti->error = "Feature corrupt_bio_byte requires parameters";
return -EINVAL;
}
r = dm_read_arg(_args + 1, as, &fc->corrupt_bio_byte, &ti->error); r = dm_read_arg(_args + 1, as, &fc->corrupt_bio_byte, &ti->error);
if (r) if (r)