Commit 690cc3ff authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller

syscall: Implement a convinience function restart_syscall

Currently when we have a signal pending we have the functionality
to restart that the current system call.  There are other cases
such as nasty lock ordering issues where it makes sense to have
a simple fix that uses try lock and restarts the system call.
Buying time to figure out how to rework the locking strategy.
Signed-off-by: default avatarEric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 69e3c75f
...@@ -2178,6 +2178,12 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) ...@@ -2178,6 +2178,12 @@ static inline int test_tsk_need_resched(struct task_struct *tsk)
return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED));
} }
static inline int restart_syscall(void)
{
set_tsk_thread_flag(current, TIF_SIGPENDING);
return -ERESTARTNOINTR;
}
static inline int signal_pending(struct task_struct *p) static inline int signal_pending(struct task_struct *p)
{ {
return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment