summaryrefslogtreecommitdiff
path: root/io_uring/notif.c
diff options
context:
space:
mode:
Diffstat (limited to 'io_uring/notif.c')
-rw-r--r--io_uring/notif.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/io_uring/notif.c b/io_uring/notif.c
index ea9c0116cec2..d8ba1165c949 100644
--- a/io_uring/notif.c
+++ b/io_uring/notif.c
@@ -14,10 +14,15 @@ static const struct ubuf_info_ops io_ubuf_ops;
static void io_notif_tw_complete(struct io_kiocb *notif, io_tw_token_t tw)
{
struct io_notif_data *nd = io_notif_to_data(notif);
+ struct io_ring_ctx *ctx = notif->ctx;
+
+ lockdep_assert_held(&ctx->uring_lock);
do {
notif = cmd_to_io_kiocb(nd);
+ if (WARN_ON_ONCE(ctx != notif->ctx))
+ return;
lockdep_assert(refcount_read(&nd->uarg.refcnt) == 0);
if (unlikely(nd->zc_report) && (nd->zc_copied || !nd->zc_used))