Commit 3e88c17d authored by Herbert Poetzl's avatar Herbert Poetzl Committed by 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: default avatarHerbert Poetzl <herbert@13thfloor.at>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 22e6c1b3
...@@ -839,7 +839,9 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, ...@@ -839,7 +839,9 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
set_blocksize(bdev, lo_blocksize); 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); wait_for_completion(&lo->lo_done);
return 0; return 0;
......
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