io_uring: debug messages syzbot-test
authorJens Axboe <axboe@kernel.dk>
Wed, 3 Mar 2021 04:00:33 +0000 (21:00 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 3 Mar 2021 04:00:33 +0000 (21:00 -0700)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index dc30034f453f5af0084833fc64d937ca7f1402e4..6e78f03f9346624897e58ec120af5c8bb63bd69b 100644 (file)
@@ -4920,8 +4920,14 @@ static int io_poll_double_wake(struct wait_queue_entry *wait, unsigned mode,
        list_del_init(&wait->entry);
 
        if (poll && poll->head) {
+               struct io_poll_iocb *dpoll = io_poll_get_double(req);
                bool done;
 
+               if (dpoll->head == poll->head)
+                       printk(KERN_ERR "poll and dpoll head identical\n");
+               else
+                       printk(KERN_ERR "poll and dpoll head different\n");
+
                spin_lock(&poll->head->lock);
                done = list_empty(&poll->wait.entry);
                if (!done)
@@ -4969,8 +4975,12 @@ static void __io_queue_proc(struct io_poll_iocb *poll, struct io_poll_table *pt,
                        return;
                }
                /* double add on the same waitqueue head, ignore */
-               if (poll->head == head)
+               if (poll->head == head) {
+                       printk(KERN_ERR "Ignore double poll same head\n");
                        return;
+               } else {
+                       printk(KERN_ERR "Double poll %lx %lx\n", (long) poll->head, (long) head);
+               }
                poll = kmalloc(sizeof(*poll), GFP_ATOMIC);
                if (!poll) {
                        pt->error = -ENOMEM;