提交 68e58a29 编写于 作者: M Mike Snitzer 提交者: Alasdair G Kergon

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: NZdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 d93dc5c4
...@@ -81,8 +81,10 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc, ...@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册