]> 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>
Thu, 21 Mar 2013 05:34:42 +0000 (16:34 +1100)
commit20bfd83aecd5096ec3b464090dbd91556c586b44
treef570689deb42d34642809b1a06f158c27d685e52
parentb5ebde9dcf8cc5677a60c05b7577f970ef5de658
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