aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/aio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 9f807a541fbe..40517f35daae 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -978,7 +978,8 @@ int fastcall aio_complete(struct kiocb *iocb, long res, long res2)
978 978
979 tail = info->tail; 979 tail = info->tail;
980 event = aio_ring_event(info, tail, KM_IRQ0); 980 event = aio_ring_event(info, tail, KM_IRQ0);
981 tail = (tail + 1) % info->nr; 981 if (++tail >= info->nr)
982 tail = 0;
982 983
983 event->obj = (u64)(unsigned long)iocb->ki_obj.user; 984 event->obj = (u64)(unsigned long)iocb->ki_obj.user;
984 event->data = iocb->ki_user_data; 985 event->data = iocb->ki_user_data;