[PATCH] linux-2.417 devfs 64bit portablility issue

From: Carsten Otte (COTTE@de.ibm.com)
Date: Mon Feb 11 2002 - 08:00:06 EST


Hi Richard, Hi List-Readers!

In linux-2.4.17/fs/devfs/util.c, I found the following code:
struct major_list
{
    spinlock_t lock;
    __u32 bits[8];
};

/* Block majors already assigned:
    0-3, 7-9, 11-63, 65-99, 101-113, 120-127, 199, 201, 240-255
    Total free: 122
*/
static struct major_list block_major_list =
{SPIN_LOCK_UNLOCKED,
    {0xfffffb8f, /* Majors 0 to 31 */
     0xffffffff, /* Majors 32 to 63 */
     0xfffffffe, /* Majors 64 to 95 */
     0xff03ffef, /* Majors 96 to 127 */
     0x00000000, /* Majors 128 to 159 */
     0x00000000, /* Majors 160 to 191 */
     0x00000280, /* Majors 192 to 223 */
     0xffff0000} /* Majors 224 to 255 */
};

Afterwards, the block_major_list.bits is processed using
find_first_zero_bit & set_bit out of asm/bitops.h.
Since bitops are only defined for the datatype long, this does
only work on 32-bit architectures (on 64 bit data gets
incorrectly alligned -not on 8byte boundary & the ordering of
the data is incorrect).
I attached a patch that should fix it for all architectures.
(See attached file: linux-2.4.17-devfs_fixup.diff)

with kind regards
Carsten Otte


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:39 EST