Skip to content

Commit

Permalink
[PATCH] loop: potential kernel hang waiting for kthread
Browse files Browse the repository at this point in the history
Check that kernel_thread() succeeded, so we don't wait for something which
cannot happen.

Signed-off-by: Herbert Poetzl <herbert@13thfloor.at>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Herbert Poetzl authored and Linus Torvalds committed Mar 26, 2006
1 parent 22e6c1b commit 3e88c17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3e88c17

Please sign in to comment.