mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
[PATCH] aio-retry-fix: fix aio retry work queueing
In the case of buffered AIO, in the aio retry path (aio_run_iocb), when the retry method returns EIOCBRETRY the kicked iocb is added to the context run list but is never queued onto the work queue. The request therefore is never completed. This patch fixes that by adding the appropriate call to aio_queue_work in aio_run_aiocb so that subsequent retries will be handled by the aio worker thread. Signed-off-by: Sbastien Dugu <sebastien.dugue@bull.net> Acked-by: Benjamin LaHaise <benjamin.c.lahaise@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
334a13ec3d
commit
c016e2257a
1 changed files with 9 additions and 0 deletions
9
fs/aio.c
9
fs/aio.c
|
@ -58,6 +58,7 @@ static DEFINE_SPINLOCK(fput_lock);
|
||||||
static LIST_HEAD(fput_head);
|
static LIST_HEAD(fput_head);
|
||||||
|
|
||||||
static void aio_kick_handler(void *);
|
static void aio_kick_handler(void *);
|
||||||
|
static void aio_queue_work(struct kioctx *);
|
||||||
|
|
||||||
/* aio_setup
|
/* aio_setup
|
||||||
* Creates the slab caches used by the aio routines, panic on
|
* Creates the slab caches used by the aio routines, panic on
|
||||||
|
@ -747,6 +748,14 @@ out:
|
||||||
* has already been kicked */
|
* has already been kicked */
|
||||||
if (kiocbIsKicked(iocb)) {
|
if (kiocbIsKicked(iocb)) {
|
||||||
__queue_kicked_iocb(iocb);
|
__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.
|
||||||
|
*/
|
||||||
|
aio_queue_work(ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue