Skip to contentSkip to conversation

AIO: Add aio_put_req() calls to io_cancel() and aio_cancel_all()

RFC PATCH New Sergey Temerkhanov 1 participant 1 message May 27, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH v2 2/3 AIO: Add aio_put_req() calls to io_cancel() and aio_cancel_all()

This patch fixes reference counting in aio_cancel_all() and io_cancel()

fs/aio.c +2 -0
diff -r 74c172a99cdb fs/aio.c
@@ -1036,6 +1036,7 @@
 			cancel(iocb, &res);
 			spin_lock_irq(&ctx->ctx_lock);
 		}
+		__aio_put_req(ctx, iocb);
 	}
 	spin_unlock_irq(&ctx->ctx_lock);
 }
@@ -1792,6 +1793,7 @@
 	} else
 		ret = -EINVAL;
 
+	aio_put_req(kiocb);
 	put_ioctx(ctx);
 
 	return ret;