parisc: enhance warning regarding usage of O_NONBLOCK
authorHelge Deller <deller@gmx.de>
Sun, 17 Oct 2021 16:53:31 +0000 (18:53 +0200)
committerHelge Deller <deller@gmx.de>
Mon, 1 Nov 2021 06:36:00 +0000 (07:36 +0100)
Instead of showing only the very first application which needs
recompile, show all of them, but print them only once.

Includes typo fix noticed by Colin Ian King.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
arch/parisc/include/asm/thread_info.h
arch/parisc/kernel/sys_parisc.c

index 4445884..75657c2 100644 (file)
@@ -48,6 +48,7 @@ struct thread_info {
 #define TIF_BLOCKSTEP          10      /* branch stepping? */
 #define TIF_SECCOMP            11      /* secure computing */
 #define TIF_SYSCALL_TRACEPOINT 12      /* syscall tracepoint instrumentation */
+#define TIF_NONBLOCK_WARNING   13      /* warned about wrong O_NONBLOCK usage */
 
 #define _TIF_SYSCALL_TRACE     (1 << TIF_SYSCALL_TRACE)
 #define _TIF_SIGPENDING                (1 << TIF_SIGPENDING)
index 5f12537..2b34294 100644 (file)
@@ -409,10 +409,12 @@ long parisc_personality(unsigned long personality)
 
 static int FIX_O_NONBLOCK(int flags)
 {
-       if (flags & O_NONBLOCK_MASK_OUT) {
-               struct task_struct *tsk = current;
-               pr_warn_once("%s(%d) uses a deprecated O_NONBLOCK value.\n",
-                       tsk->comm, tsk->pid);
+       if ((flags & O_NONBLOCK_MASK_OUT) &&
+                       !test_thread_flag(TIF_NONBLOCK_WARNING)) {
+               set_thread_flag(TIF_NONBLOCK_WARNING);
+               pr_warn("%s(%d) uses a deprecated O_NONBLOCK value."
+                       " Please recompile with newer glibc.\n",
+                       current->comm, current->pid);
        }
        return flags & ~O_NONBLOCK_MASK_OUT;
 }