Re: [patch] futex-2.5.42-A2

Rusty Russell (rusty@rustcorp.com.au)
Wed, 16 Oct 2002 12:26:02 +1000


In message <Pine.LNX.4.44.0210152157001.21066-100000@localhost.localdomain> you
write:
> - simplified alignment check in sys_futex. (Martin Wirth)

Um, this test existed for a reason:

> - /* Must be "naturally" aligned, and not on page boundary. */
> - if ((pos_in_page % __alignof__(int)) != 0
> - || pos_in_page + sizeof(int) > PAGE_SIZE)
> + /* Must be "naturally" aligned */
> + if (pos_in_page % sizeof(int))
> return -EINVAL;

If you do this, *please* add:
/* Above check not sufficient if align of int < size. Break link. */
if (__alignof__(int) < sizeof(int)) {
extern void __error_small_int_align();
__error_small_int_align();
}

Cheers,
Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
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/