diff -Nur linux-2.5.74/fs/aio.c linux-2.5.74.aio/fs/aio.c --- linux-2.5.74/fs/aio.c Sun Jun 22 11:32:43 2003 +++ linux-2.5.74.aio/fs/aio.c Tue Jul 8 14:49:27 2003 @@ -679,12 +679,11 @@ /* after flagging the request as done, we * must never even look at it again */ - barrier(); + wmb(); /* make event visible before updating tail */ info->tail = tail; ring->tail = tail; - wmb(); put_aio_ring_event(event, KM_IRQ0); kunmap_atomic(ring, KM_IRQ1); @@ -721,7 +720,7 @@ dprintk("in aio_read_evt h%lu t%lu m%lu\n", (unsigned long)ring->head, (unsigned long)ring->tail, (unsigned long)ring->nr); - barrier(); + if (ring->head == ring->tail) goto out; @@ -732,7 +731,7 @@ struct io_event *evp = aio_ring_event(info, head, KM_USER1); *ent = *evp; head = (head + 1) % info->nr; - barrier(); + mb(); /* finish reading the event before updatng the head */ ring->head = head; ret = 1; put_aio_ring_event(evp, KM_USER1);