[Devel] [PATCH rh7] fs/aio-nr: fix decrement of aio-nr

Andrey Ryabinin aryabinin at virtuozzo.com
Fri May 27 08:35:06 PDT 2016


Patch 'fs/aio: show real number of aio events in fs.aio-nr sysctl'
changed only incrementing of fs.aio-nr counter. It failed to update
decrement path which leads to constant growing of fs.aio-nr value.

Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 fs/aio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 0f00aa0..96f30d4 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -710,8 +710,8 @@ static int kill_ioctx(struct mm_struct *mm, struct kioctx *ctx,
 		 *  could tell).
 		 */
 		spin_lock(&ve->aio_nr_lock);
-		BUG_ON(ve->aio_nr - ctx->max_reqs > ve->aio_nr);
-		ve->aio_nr -= ctx->max_reqs;
+		BUG_ON(ve->aio_nr - ctx->nr_events > ve->aio_nr);
+		ve->aio_nr -= ctx->nr_events;
 		spin_unlock(&ve->aio_nr_lock);
 
 		if (ctx->mmap_size)
-- 
2.7.3



More information about the Devel mailing list