aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2005-11-22 00:32:33 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-22 12:14:31 -0500
commitc4cc66351a24da5feec298be2da59a85f68dd3ea (patch)
tree76b03b0bfa3d6db905b9b7e26997263b01cbe3ee /drivers/md
parentb6fcc80d03b41162ed88c3fb542aca9b654bc414 (diff)
[PATCH] device-mapper: list_versions fix
In some circumstances the LIST_VERSIONS output is truncated because the size calculation forgets about a 'uint32_t' in each structure - but the inclusion of the whole of ALIGN_MASK frequently compensates for the omission. This is a quick workaround to use an upper bound. (The code ought to be fixed to supply the actual size.) Running 'dmsetup targets' may demonstrate the problem: when I run it, the last line comes out as 'erro' instead of 'error'. Consequently, 'lvcreate --type error' doesn't work. 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')
-rw-r--r--drivers/md/dm-ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index a90b053368ee..07d44e19536e 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -425,8 +425,8 @@ static void list_version_get_needed(struct target_type *tt, void *needed_param)
425{ 425{
426 size_t *needed = needed_param; 426 size_t *needed = needed_param;
427 427
428 *needed += sizeof(struct dm_target_versions);
428 *needed += strlen(tt->name); 429 *needed += strlen(tt->name);
429 *needed += sizeof(tt->version);
430 *needed += ALIGN_MASK; 430 *needed += ALIGN_MASK;
431} 431}
432 432