uml: aIO deadlock avoidance
authorJeff Dike <jdike@addtoit.com>
Sun, 6 May 2007 21:51:44 +0000 (14:51 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 7 May 2007 19:13:03 +0000 (12:13 -0700)
Allow deadlocks to be avoided in the AIO code by setting the pipe to the I/O
thread non-blocking.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/os-Linux/aio.c

index 5d258eb4f50645f237b4dd1e0ec880bd1145e26f..9bf944f6a1dbe75639e4ae029938929c7b0d03d0 100644 (file)
@@ -221,6 +221,11 @@ static int init_aio_24(void)
 
        aio_req_fd_w = fds[0];
        aio_req_fd_r = fds[1];
+
+       err = os_set_fd_block(aio_req_fd_w, 0);
+       if(err)
+               goto out_close_pipe;
+
        err = run_helper_thread(not_aio_thread, NULL,
                                CLONE_FILES | CLONE_VM | SIGCHLD, &stack, 0);
        if(err < 0)