kernel/sys.c: fix compat uname machine
authorAndreas Schwab <schwab@linux-m68k.org>
Fri, 23 Apr 2010 17:17:44 +0000 (13:17 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 24 Apr 2010 18:31:24 +0000 (11:31 -0700)
On ppc64 you get this error:

  $ setarch ppc -R true
  setarch: ppc: Unrecognized architecture

because uname still reports ppc64 as the machine.

So mask off the personality flags when checking for PER_LINUX32.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/sys.c

index 6d1a7e0..7cb426a 100644 (file)
@@ -1118,7 +1118,7 @@ DECLARE_RWSEM(uts_sem);
 
 #ifdef COMPAT_UTS_MACHINE
 #define override_architecture(name) \
-       (current->personality == PER_LINUX32 && \
+       (personality(current->personality) == PER_LINUX32 && \
         copy_to_user(name->machine, COMPAT_UTS_MACHINE, \
                      sizeof(COMPAT_UTS_MACHINE)))
 #else