diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-10-10 19:31:47 -0700 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-10-10 19:31:47 -0700 |
commit | e34ecee2ae791df674dfb466ce40692ca6218e43 (patch) | |
tree | 0ce1c1ad368f8e0562f0b656142dcfd5c070d66c /firmware | |
parent | d0e639c9e06d44e713170031fe05fb60ebe680af (diff) | |
download | op-kernel-dev-e34ecee2ae791df674dfb466ce40692ca6218e43.zip op-kernel-dev-e34ecee2ae791df674dfb466ce40692ca6218e43.tar.gz |
aio: Fix a trinity splat
aio kiocb refcounting was broken - it was relying on keeping track of
the number of available ring buffer entries, which it needs to do
anyways; then at shutdown time it'd wait for completions to be delivered
until the # of available ring buffer entries equalled what it was
initialized to.
Problem with that is that the ring buffer is mapped writable into
userspace, so userspace could futz with the head and tail pointers to
cause the kernel to see extra completions, and cause free_ioctx() to
return while there were still outstanding kiocbs. Which would be bad.
Fix is just to directly refcount the kiocbs - which is more
straightforward, and with the new percpu refcounting code doesn't cost
us any cacheline bouncing which was the whole point of the original
scheme.
Also clean up ioctx_alloc()'s error path and fix a bug where it wasn't
subtracting from aio_nr if ioctx_add_table() failed.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions