diff options
author | Milan Broz <mbroz@redhat.com> | 2007-10-19 17:38:36 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2007-10-19 21:00:58 -0400 |
commit | 027d50f92ea26fd065aeb141ebfcbbbe010825e3 (patch) | |
tree | e02900d49590ece0e43e21b006c39de08b1178be /include/linux | |
parent | c7ac86de6a1bcb1b59c83e19b0d0d64a59604ade (diff) |
dm io:ctl use constant struct size
Make size of dm_ioctl struct always 312 bytes on all supported
architectures.
This change retains compatibility with already-compiled code because
it uses an embedded offset to locate the payload that follows the
structure.
On 64-bit architectures there is no change at all; on 32-bit
we are increasing the size of dm-ioctl from 308 to 312 bytes.
Currently with 32-bit userspace / 64-bit kernel on x86_64
some ioctls (including rename, message) are incorrectly rejected
by the comparison against 'param + 1'. This breaks userspace
lvrename and multipath 'fail_if_no_path' changes, for example.
(BTW Device-mapper uses its own versioning and ignores the ioctl
size bits. Only the generic ioctl compat code on mixed arches
checks them, and that will continue to accept both sizes for now,
but we intend to list 308 as deprecated and eventually remove it.)
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: Guido Guenther <agx@sigxcpu.org>
Cc: Kevin Corry <kevcorry@us.ibm.com>
Cc: stable@kernel.org
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/dm-ioctl.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index b93486107821..523281c5b7f5 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -131,6 +131,7 @@ struct dm_ioctl { | |||
131 | char name[DM_NAME_LEN]; /* device name */ | 131 | char name[DM_NAME_LEN]; /* device name */ |
132 | char uuid[DM_UUID_LEN]; /* unique identifier for | 132 | char uuid[DM_UUID_LEN]; /* unique identifier for |
133 | * the block device */ | 133 | * the block device */ |
134 | char data[7]; /* padding or data */ | ||
134 | }; | 135 | }; |
135 | 136 | ||
136 | /* | 137 | /* |
@@ -285,9 +286,9 @@ typedef char ioctl_struct[308]; | |||
285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 286 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
286 | 287 | ||
287 | #define DM_VERSION_MAJOR 4 | 288 | #define DM_VERSION_MAJOR 4 |
288 | #define DM_VERSION_MINOR 11 | 289 | #define DM_VERSION_MINOR 12 |
289 | #define DM_VERSION_PATCHLEVEL 0 | 290 | #define DM_VERSION_PATCHLEVEL 0 |
290 | #define DM_VERSION_EXTRA "-ioctl (2006-10-12)" | 291 | #define DM_VERSION_EXTRA "-ioctl (2007-10-02)" |
291 | 292 | ||
292 | /* Status bits */ | 293 | /* Status bits */ |
293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 294 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |