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