summaryrefslogtreecommitdiffstats
path: root/fs/aio.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/aio.c')
-rw-r--r--fs/aio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 9f807a5..40517f3 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -978,7 +978,8 @@ int fastcall aio_complete(struct kiocb *iocb, long res, long res2)
tail = info->tail;
event = aio_ring_event(info, tail, KM_IRQ0);
- tail = (tail + 1) % info->nr;
+ if (++tail >= info->nr)
+ tail = 0;
event->obj = (u64)(unsigned long)iocb->ki_obj.user;
event->data = iocb->ki_user_data;
OpenPOWER on IntegriCloud