]> git.karo-electronics.de Git - karo-tx-linux.git/commit
aio: correct calculation of available events
authorBenjamin LaHaise <bcrl@kvack.org>
Wed, 20 Mar 2013 04:09:02 +0000 (15:09 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Mar 2013 04:23:42 +0000 (15:23 +1100)
commit29bb96df26183f39e59d6324170e6f569f4bde8d
tree62e20c2adb4ca4ea2febb1ac0eb92e7c249a8522
parentb3841c6ca97a10c691b307f4bfb368b61e08ec11
aio: correct calculation of available events

When the number of available events in the ring buffer is calculated, the
avail calculation is incorrect when head == tail.  This is harmless in
aio_read_events_ring(), but in free_ioctx() leads to the subsequent
WARN_ON(atomic_read(&ctx->reqs_available) > ctx->nr).  Correct this.

Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Reviewed-by: Kent Overstreet <koverstreet@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/aio.c