1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

o Don't use dmt->dmi until it has been initialised.

This commit is contained in:
Joe Thornber 2001-11-21 14:52:16 +00:00
parent 19df7116c6
commit d04ef4c26d

View File

@ -172,7 +172,7 @@ int dm_task_add_target(struct dm_task *dmt,
static void *_align(void *ptr, unsigned int align) static void *_align(void *ptr, unsigned int align)
{ {
align--; align--;
return (void *) (((long) ptr + align) & ~align); return (void *) (((unsigned long) ptr + align) & ~align);
} }
static void *_add_target(struct target *t, void *out, void *end) static void *_add_target(struct target *t, void *out, void *end)
@ -245,6 +245,8 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt)
if (!(b = _add_target(t, b, e))) if (!(b = _add_target(t, b, e)))
goto bad; goto bad;
fprintf(stderr, "dm_ioctl size = %lu\n", dmi->data_size);
return dmi; return dmi;
bad: bad:
@ -397,7 +399,7 @@ int dm_task_run(struct dm_task *dmt)
switch (dmt->type) { switch (dmt->type) {
case DM_DEVICE_CREATE: case DM_DEVICE_CREATE:
_add_dev_node(dmt->dev_name, dmt->dmi->minor); _add_dev_node(dmt->dev_name, dmi->minor);
break; break;
case DM_DEVICE_REMOVE: case DM_DEVICE_REMOVE: