diff options
author | Alex Shi <alex.shi@linaro.org> | 2016-12-01 12:01:44 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-12-01 12:01:44 +0800 |
commit | 2e67ba554184199114a948786e47decb8b9a469b (patch) | |
tree | 1ed97bafe8b2c58171dceb88c6a6f1ff86f52084 /drivers/md/dm-table.c | |
parent | e5dd309b741e2e4d7e71da61e07249f91c80065e (diff) | |
parent | ac3d826bef907afe35f80ecccbcdd57223df4b88 (diff) |
Merge tag 'v3.18.45' into linux-linaro-lsk-v3.18lsk-v3.18-16.12
This is the 3.18.45 stable release
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index b2bd1ebf4562..fc93bd80270f 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -691,37 +691,32 @@ int dm_table_add_target(struct dm_table *t, const char *type, tgt->type = dm_get_target_type(type); if (!tgt->type) { - DMERR("%s: %s: unknown target type", dm_device_name(t->md), - type); + DMERR("%s: %s: unknown target type", dm_device_name(t->md), type); return -EINVAL; } if (dm_target_needs_singleton(tgt->type)) { if (t->num_targets) { - DMERR("%s: target type %s must appear alone in table", - dm_device_name(t->md), type); - return -EINVAL; + tgt->error = "singleton target type must appear alone in table"; + goto bad; } t->singleton = 1; } if (dm_target_always_writeable(tgt->type) && !(t->mode & FMODE_WRITE)) { - DMERR("%s: target type %s may not be included in read-only tables", - dm_device_name(t->md), type); - return -EINVAL; + tgt->error = "target type may not be included in a read-only table"; + goto bad; } if (t->immutable_target_type) { if (t->immutable_target_type != tgt->type) { - DMERR("%s: immutable target type %s cannot be mixed with other target types", - dm_device_name(t->md), t->immutable_target_type->name); - return -EINVAL; + tgt->error = "immutable target type cannot be mixed with other target types"; + goto bad; } } else if (dm_target_is_immutable(tgt->type)) { if (t->num_targets) { - DMERR("%s: immutable target type %s cannot be mixed with other target types", - dm_device_name(t->md), tgt->type->name); - return -EINVAL; + tgt->error = "immutable target type cannot be mixed with other target types"; + goto bad; } t->immutable_target_type = tgt->type; } @@ -736,7 +731,6 @@ int dm_table_add_target(struct dm_table *t, const char *type, */ if (!adjoin(t, tgt)) { tgt->error = "Gap in table"; - r = -EINVAL; goto bad; } |