]> git.karo-electronics.de Git - karo-tx-linux.git/commit
aio: fix ringbuffer calculation so we don't wrap
authorKent Overstreet <koverstreet@google.com>
Wed, 20 Mar 2013 04:09:02 +0000 (15:09 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 22 Mar 2013 04:34:14 +0000 (15:34 +1100)
commit4cf928609f226312f8a35bea09ce723dba45563b
treec7cb5efa92134b0036afad92f0fbdcfbd3247580
parent886817a096dd83d8d2ef8a86cad2621ddfa751de
aio: fix ringbuffer calculation so we don't wrap

When calculating the size of the ringbuffer, aio_setup_ring() adds 2 to
nr_events so that the head and tail entries don't overlap when the
ringbuffer fills up.

But then later the code uses the calculated ringbuffer size for the
maximum number of outstanding kiocbs, so this buffer doesn't actually get
used.  Ouch.

Fix it so the ringbuffer size and maximum number of requests are distinct
again, and document things while we're at it.

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