提交 3e88c17d 编写于 作者: H Herbert Poetzl 提交者: Linus Torvalds

[PATCH] loop: potential kernel hang waiting for kthread

Check that kernel_thread() succeeded, so we don't wait for something which
cannot happen.
Signed-off-by: NHerbert Poetzl <herbert@13thfloor.at>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 22e6c1b3
......@@ -839,7 +839,9 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
set_blocksize(bdev, lo_blocksize);
kernel_thread(loop_thread, lo, CLONE_KERNEL);
error = kernel_thread(loop_thread, lo, CLONE_KERNEL);
if (error < 0)
goto out_putf;
wait_for_completion(&lo->lo_done);
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册