ret = retry(iocb);
current->io_wait = NULL;
- if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) {
+ if (ret == -EIOCBRETRY) {
+ if (list_empty(&iocb->ki_wq.wait.task_list))
+ kiocbSetKicked(iocb);
+ } else if (ret != -EIOCBQUEUED) {
BUG_ON(!list_empty(&iocb->ki_wq.wait.task_list));
aio_complete(iocb, ret, 0);
}
__queue_kicked_iocb(iocb);
/*
- * __queue_kicked_iocb will always return 1 here, because
- * iocb->ki_run_list is empty at this point so it should
- * be safe to unconditionally queue the context into the
- * work queue.
+ * __queue_kicked_iocb will always return 1 here,
+ * because iocb->ki_run_list is empty at this point so
+ * it should be safe to unconditionally queue the
+ * context into the work queue.
*/
aio_queue_work(ctx);
}
static inline int is_sync_wait_bit_queue(struct wait_bit_queue *wq)
{
- return is_sync_wait(&wq->wait);
+ if (wq)
+ return is_sync_wait(&wq->wait);
+
+ return 1;
}
#define in_aio(tsk) is_sync_wait_bit_queue((tsk)->io_wait)