mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 13:31:02 +07:00
[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: Herbert Poetzl <herbert@13thfloor.at> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
22e6c1b39c
commit
3e88c17d40
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user