History

unbreak automounter support on 64-bit kernel with 32-bit userspace (v2)

automount-support is broken on the parisc architecture, because the existing #if list does not include a check for defined(__hppa__). The HPPA (parisc) architecture is similiar to other 64bit Linux targets where we have to define autofs_wqt_t (which is passed back and forth to user space) as int type which has a size of 32bit across 32 and 64bit kernels. During the discussion on the mailing list, H. Peter Anvin suggested to invert the #if list since only specific platforms (specifically those who do not have a 32bit userspace, like IA64 and Alpha) should have autofs_wqt_t as unsigned long type. This suggestion is probably the best way to go, since Arm64 (and maybe others?) seems to have a non-working automounter. So in the long run even for other new upcoming architectures this inverted check seem to be the best solution, since it will not require them to change this #if again (unless they are 64bit only).

Helge Deller committed 13 years ago

Commit 4f4ffc31 parent 124b69b1 file · +8 −17Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/auto_fs.h+8−17
@@ -28,25 +28,16 @@ · 27 unmodified lines
2828 #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
2929
3030 /*
31− * Architectures where both 32- and 64-bit binaries can be executed
32− * on 64-bit kernels need this. This keeps the structure format
33− * uniform, and makes sure the wait_queue_token isn't too big to be
34− * passed back down to the kernel.
35− *
36− * This assumes that on these architectures:
37− * mode 32 bit 64 bit
38− * -------------------------
39− * int 32 bit 32 bit
40− * long 32 bit 64 bit
41− *
42− * If so, 32-bit user-space code should be backwards compatible.
31+ * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed
32+ * back to the kernel via ioctl from userspace. On architectures where 32- and
33+ * 64-bit userspace binaries can be executed it's important that the size of
34+ * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we
35+ * do not break the binary ABI interface by changing the structure size.
4336 */
44−
45−#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \
46− || defined(__powerpc__) || defined(__s390__)
47−typedef unsigned int autofs_wqt_t;
48−#else
37+#if defined(__ia64__) || defined(__alpha__) /* pure 64bit architectures */
4938 typedef unsigned long autofs_wqt_t;
39+#else
40+typedef unsigned int autofs_wqt_t;
5041 #endif
5142
5243 /* Packet types */