diff options
author | Alasdair G Kergon <agk@redhat.com> | 2006-06-26 03:27:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:36 -0400 |
commit | 72d9486169a2a8353e022813185ba2f32d7dde69 (patch) | |
tree | 2fe6c382feb3f21d829abf543c54be486007557c /drivers/md/dm-table.c | |
parent | 5c6bd75d06db512515a3781aa97e42df2faf0815 (diff) |
[PATCH] dm: improve error message consistency
Tidy device-mapper error messages to include context information
automatically.
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 827b648fac50..75fe9493e6af 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
19 | 19 | ||
20 | #define DM_MSG_PREFIX "table" | ||
21 | |||
20 | #define MAX_DEPTH 16 | 22 | #define MAX_DEPTH 16 |
21 | #define NODE_SIZE L1_CACHE_BYTES | 23 | #define NODE_SIZE L1_CACHE_BYTES |
22 | #define KEYS_PER_NODE (NODE_SIZE / sizeof(sector_t)) | 24 | #define KEYS_PER_NODE (NODE_SIZE / sizeof(sector_t)) |
@@ -715,15 +717,14 @@ int dm_table_add_target(struct dm_table *t, const char *type, | |||
715 | memset(tgt, 0, sizeof(*tgt)); | 717 | memset(tgt, 0, sizeof(*tgt)); |
716 | 718 | ||
717 | if (!len) { | 719 | if (!len) { |
718 | tgt->error = "zero-length target"; | 720 | DMERR("%s: zero-length target", dm_device_name(t->md)); |
719 | DMERR("%s", tgt->error); | ||
720 | return -EINVAL; | 721 | return -EINVAL; |
721 | } | 722 | } |
722 | 723 | ||
723 | tgt->type = dm_get_target_type(type); | 724 | tgt->type = dm_get_target_type(type); |
724 | if (!tgt->type) { | 725 | if (!tgt->type) { |
725 | tgt->error = "unknown target type"; | 726 | DMERR("%s: %s: unknown target type", dm_device_name(t->md), |
726 | DMERR("%s", tgt->error); | 727 | type); |
727 | return -EINVAL; | 728 | return -EINVAL; |
728 | } | 729 | } |
729 | 730 | ||
@@ -760,7 +761,7 @@ int dm_table_add_target(struct dm_table *t, const char *type, | |||
760 | return 0; | 761 | return 0; |
761 | 762 | ||
762 | bad: | 763 | bad: |
763 | DMERR("%s", tgt->error); | 764 | DMERR("%s: %s: %s", dm_device_name(t->md), type, tgt->error); |
764 | dm_put_target_type(tgt->type); | 765 | dm_put_target_type(tgt->type); |
765 | return r; | 766 | return r; |
766 | } | 767 | } |