]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.34.6/sparc64-fix-rwsem-constant-bug-leading-to-hangs.patch
Drop nfc patches from older trees
[thirdparty/kernel/stable-queue.git] / releases / 2.6.34.6 / sparc64-fix-rwsem-constant-bug-leading-to-hangs.patch
1 From f23bfe840d9dee81b3be25eb3fd5e715b4fdee5a Mon Sep 17 00:00:00 2001
2 From: David S. Miller <davem@davemloft.net>
3 Date: Tue, 17 Aug 2010 17:09:53 -0700
4 Subject: sparc64: Fix rwsem constant bug leading to hangs.
5
6 From: David S. Miller <davem@davemloft.net>
7
8 [ Upstream commit ef201bebe5afc91a2b99b45dacc8c6dd88ca9e58 ]
9
10 As noticed by Linus, it is critical that some of the
11 rwsem constants be signed. Yet, hex constants are
12 unsigned unless explicitly casted or negated.
13
14 The most critical one is RWSEM_WAITING_BIAS.
15
16 This bug was exacerbated by commit
17 424acaaeb3a3932d64a9b4bd59df6cf72c22d8f3 ("rwsem: wake queued readers
18 when writer blocks on active read lock")
19
20 Signed-off-by: David S. Miller <davem@davemloft.net>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22 ---
23 arch/sparc/include/asm/rwsem-const.h | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26 --- a/arch/sparc/include/asm/rwsem-const.h
27 +++ b/arch/sparc/include/asm/rwsem-const.h
28 @@ -5,7 +5,7 @@
29 #define RWSEM_UNLOCKED_VALUE 0x00000000
30 #define RWSEM_ACTIVE_BIAS 0x00000001
31 #define RWSEM_ACTIVE_MASK 0x0000ffff
32 -#define RWSEM_WAITING_BIAS 0xffff0000
33 +#define RWSEM_WAITING_BIAS (-0x00010000)
34 #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
35 #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
36