From 77714f374ed746840e6e9ee6f8c89f9f27e65950 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Fri, 20 Mar 2015 10:04:00 +0100 Subject: [PATCH] aio: safeguard ioctx --- kernel/mars_aio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/mars_aio.c b/kernel/mars_aio.c index 949c6a66..8e41161b 100644 --- a/kernel/mars_aio.c +++ b/kernel/mars_aio.c @@ -635,6 +635,11 @@ static int aio_event_thread(void *data) .tv_sec = 1, }; + if (unlikely(!(void*)output->ctxp)) { + MARS_ERR("Oops, context vanished. queued_sum = %d\n", atomic_read(&tinfo->queued_sum)); + break; + } + oldfs = get_fs(); set_fs(get_ds()); /* TODO: don't timeout upon termination.