]> git.karo-electronics.de Git - karo-tx-linux.git/commit
aio: fix kioctx not being freed after cancellation at exit time
authorBenjamin LaHaise <bcrl@kvack.org>
Tue, 26 Mar 2013 23:26:28 +0000 (10:26 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Apr 2013 06:26:42 +0000 (17:26 +1100)
commit8fce27162a1f3be89430bffc7f1421218ec34071
treeb3f7b4cda6c2b7d87cba64adf83ea7aaaa176259
parent00fcef54098f8b14f788b19825af08659e409b54
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