[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>

authored by Alasdair G Kergon and committed by Linus Torvalds c4cc6635 b6fcc80d

+1 -1
+1 -1
drivers/md/dm-ioctl.c
··· 425 425 { 426 426 size_t *needed = needed_param; 427 427 428 + *needed += sizeof(struct dm_target_versions); 428 429 *needed += strlen(tt->name); 429 - *needed += sizeof(tt->version); 430 430 *needed += ALIGN_MASK; 431 431 } 432 432