aio: add missing smp_rmb() in read_events_ring
authorJeff Moyer <jmoyer@redhat.com>
Tue, 2 Sep 2014 17:17:00 +0000 (13:17 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:52:10 +0000 (14:52 -0700)
commit42dd6eb155777748a1c8637614f9a03c9ebc69b6
treec82c8658e0d2eb5e4395ec2298794905aa3b6636
parent1a678fac10d094e0b826fb44da1860d73ae0c8d8
aio: add missing smp_rmb() in read_events_ring

commit 2ff396be602f10b5eab8e73b24f20348fa2de159 upstream.

We ran into a case on ppc64 running mariadb where io_getevents would
return zeroed out I/O events.  After adding instrumentation, it became
clear that there was some missing synchronization between reading the
tail pointer and the events themselves.  This small patch fixes the
problem in testing.

Thanks to Zach for helping to look into this, and suggesting the fix.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/aio.c