aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/background.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2015-11-06 19:32:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-06 20:50:42 -0500
commit9a13049e83f346cb1cbd60c64e520a73c396af16 (patch)
tree11a2ac2ac28dbfa477d5b4f1e14a2173b4867a8f /fs/jffs2/background.c
parentbe0e6f290f78b84a3b21b8c8c46819c4514fe632 (diff)
signal: introduce kernel_signal_stop() to fix jffs2_garbage_collect_thread()
jffs2_garbage_collect_thread() can race with SIGCONT and sleep in TASK_STOPPED state after it was already sent. Add the new helper, kernel_signal_stop(), which does this correctly. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Tejun Heo <tj@kernel.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Felipe Balbi <balbi@ti.com> Cc: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/jffs2/background.c')
-rw-r--r--fs/jffs2/background.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c
index f3145fd86d86..53cc7350af33 100644
--- a/fs/jffs2/background.c
+++ b/fs/jffs2/background.c
@@ -132,8 +132,7 @@ static int jffs2_garbage_collect_thread(void *_c)
132 case SIGSTOP: 132 case SIGSTOP:
133 jffs2_dbg(1, "%s(): SIGSTOP received\n", 133 jffs2_dbg(1, "%s(): SIGSTOP received\n",
134 __func__); 134 __func__);
135 set_current_state(TASK_STOPPED); 135 kernel_signal_stop();
136 schedule();
137 break; 136 break;
138 137
139 case SIGKILL: 138 case SIGKILL: