]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
aio: fix kioctx not being freed after cancellation at exit time
authorBenjamin LaHaise <bcrl@kvack.org>
Sat, 23 Mar 2013 02:33:19 +0000 (13:33 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 26 Mar 2013 05:33:43 +0000 (16:33 +1100)
commit7f6703bb85e371719de33778261c95fcdc4cc796
tree6bf4814bce838cf9348796338e8fa7d720e3e63d
parente4e0f133415f71846fa872d11c678715f0ed7e51
aio: fix kioctx not being freed after cancellation at exit time

The recent changes overhauling fs/aio.c introduced a bug that results in the
kioctx not being freed when outstanding kiocbs are cancelled at exit_aio()
time.  Specifically, a kiocb that is cancelled has its completion events
discarded by batch_complete_aio(), which then fails to wake up the process
stuck in free_ioctx().  Fix this by removing the event suppression in
batch_complete_aio() and modify the wait_event() condition in free_ioctx()
appropriately.

This patch was tested with the cancel operation in the thread based code
posted yesterday.

Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Kent Overstreet <koverstreet@google.com>
Cc: Kent Overstreet <koverstreet@google.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Cc: Zach Brown <zab@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/aio.c