set_restore_sigmask() is never called without SIGPENDING (and never should be)
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 27 Apr 2012 17:42:45 +0000 (13:42 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 1 Jun 2012 16:58:50 +0000 (12:58 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/ia64/include/asm/thread_info.h
arch/microblaze/include/asm/thread_info.h
arch/powerpc/include/asm/thread_info.h
arch/sh/include/asm/thread_info.h
arch/sparc/include/asm/thread_info_64.h
arch/tile/include/asm/thread_info.h
arch/x86/include/asm/thread_info.h
include/linux/thread_info.h

index 8d60036..f7ee853 100644 (file)
@@ -141,7 +141,7 @@ static inline void set_restore_sigmask(void)
 {
        struct thread_info *ti = current_thread_info();
        ti->status |= TS_RESTORE_SIGMASK;
-       set_bit(TIF_SIGPENDING, &ti->flags);
+       WARN_ON(!test_bit(TIF_SIGPENDING, &ti->flags));
 }
 static inline void clear_restore_sigmask(void)
 {
index 12e3920..6c61023 100644 (file)
@@ -166,7 +166,7 @@ static inline void set_restore_sigmask(void)
 {
        struct thread_info *ti = current_thread_info();
        ti->status |= TS_RESTORE_SIGMASK;
-       set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
+       WARN_ON(!test_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags));
 }
 static inline void clear_restore_sigmask(void)
 {
index 85d50a9..68831e9 100644 (file)
@@ -140,7 +140,7 @@ static inline void set_restore_sigmask(void)
 {
        struct thread_info *ti = current_thread_info();
        ti->local_flags |= _TLF_RESTORE_SIGMASK;
-       set_bit(TIF_SIGPENDING, &ti->flags);
+       WARN_ON(!test_bit(TIF_SIGPENDING, &ti->flags));
 }
 static inline void clear_restore_sigmask(void)
 {
index a109157..bc13b57 100644 (file)
@@ -169,7 +169,7 @@ static inline void set_restore_sigmask(void)
 {
        struct thread_info *ti = current_thread_info();
        ti->status |= TS_RESTORE_SIGMASK;
-       set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
+       WARN_ON(!test_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags));
 }
 
 #define TI_FLAG_FAULT_CODE_SHIFT       24
index cb9b7a9..cfa8c38 100644 (file)
@@ -238,7 +238,7 @@ static inline void set_restore_sigmask(void)
 {
        struct thread_info *ti = current_thread_info();
        ti->status |= TS_RESTORE_SIGMASK;
-       set_bit(TIF_SIGPENDING, &ti->flags);
+       WARN_ON(!test_bit(TIF_SIGPENDING, &ti->flags));
 }
 static inline void clear_restore_sigmask(void)
 {
index 5aef371..7e1fef3 100644 (file)
@@ -166,7 +166,7 @@ static inline void set_restore_sigmask(void)
 {
        struct thread_info *ti = current_thread_info();
        ti->status |= TS_RESTORE_SIGMASK;
-       set_bit(TIF_SIGPENDING, &ti->flags);
+       WARN_ON(!test_bit(TIF_SIGPENDING, &ti->flags));
 }
 static inline void clear_restore_sigmask(void)
 {
index 8f3f1ff..89f794f 100644 (file)
@@ -248,7 +248,7 @@ static inline void set_restore_sigmask(void)
 {
        struct thread_info *ti = current_thread_info();
        ti->status |= TS_RESTORE_SIGMASK;
-       set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
+       WARN_ON(!test_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags));
 }
 static inline void clear_restore_sigmask(void)
 {
index ed27970..ccc1899 100644 (file)
@@ -8,6 +8,7 @@
 #define _LINUX_THREAD_INFO_H
 
 #include <linux/types.h>
+#include <linux/bug.h>
 
 struct timespec;
 struct compat_timespec;
@@ -125,7 +126,7 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
 static inline void set_restore_sigmask(void)
 {
        set_thread_flag(TIF_RESTORE_SIGMASK);
-       set_thread_flag(TIF_SIGPENDING);
+       WARN_ON(!test_thread_flag(TIF_SIGPENDING));
 }
 static inline void clear_restore_sigmask(void)
 {