Re: [PATCH] Fix big endian ext2 bmap in 2.2.

From: Alexander Viro (viro@math.psu.edu)
Date: Tue Sep 19 2000 - 19:01:46 EDT

  • Next message: Alexander Viro: "[PATCH] abuse of macros in swab.h"

    On Wed, 20 Sep 2000, Andi Kleen wrote:

    >
    > This patch fixes an obvious bug introduced with the ext2 changes in 2.2.18pre
    > (look up the definition of le32_to_cpu on BE machines without a special
    > assembler version for it and on machines that have it)
    >
    > Patch against 2.2.18pre9

    Wrong fix. swab32() is the guilty party here - it should be

    static inline __u32 swab32(__u32 x)
    {
            return
                    ((x & (__u32)0x000000ffUL) << 24) |
                    ((x & (__u32)0x0000ff00UL) << 8) |
                    ((x & (__u32)0x00ff0000UL) >> 8) |
                    ((x & (__u32)0xff000000UL) >> 24) );
    }

    Ditto for other stuff in linux/byteorder/swab.h

    My fault - I didn't realize that the bloody thing was a macro (it
    obviously shouldn't be, exactly due to problems with side effects).

    Alan, what do you prefer? I think that fixing the macros in swab.h is the
    Right Thing(tm).

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



    This archive was generated by hypermail 2b29 : Tue Sep 19 2000 - 19:03:10 EDT