debug stuff and fixes
authorJens Axboe <jens.axboe@oracle.com>
Thu, 15 Jan 2009 11:32:46 +0000 (12:32 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Sat, 26 Sep 2009 15:36:13 +0000 (17:36 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/aio.c
mm/filemap.c

index 39ee8d1cbc0a1b51cafadb2fb39ac7ea1ccfb4e6..7d63608532fae02f24d5903d4def6289440b2d7b 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -681,6 +681,7 @@ static ssize_t aio_run_iocb(struct kiocb *iocb)
         * queue this on the run list yet)
         */
        iocb->ki_run_list.next = iocb->ki_run_list.prev = NULL;
+       iocb->ki_retry = NULL;
        spin_unlock_irq(&ctx->ctx_lock);
 
        /* Quit retrying if the i/o has been cancelled */
@@ -695,7 +696,7 @@ static ssize_t aio_run_iocb(struct kiocb *iocb)
         * Now we are all set to call the retry method in async
         * context.
         */
-       BUG_ON(current->io_wait != NULL);
+       BUG_ON(current->io_wait);
        current->io_wait = &iocb->ki_wq;
        ret = retry(iocb);
        current->io_wait = NULL;
@@ -710,7 +711,7 @@ static ssize_t aio_run_iocb(struct kiocb *iocb)
 out:
        spin_lock_irq(&ctx->ctx_lock);
 
-       if (-EIOCBRETRY == ret) {
+       if (ret == -EIOCBRETRY) {
                /*
                 * OK, now that we are done with this iteration
                 * and know that there is more left to go,
@@ -735,6 +736,7 @@ out:
                        aio_queue_work(ctx);
                }
        }
+
        return ret;
 }
 
@@ -1615,11 +1617,13 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
 
        spin_lock_irq(&ctx->ctx_lock);
        aio_run_iocb(req);
+#if 0
        if (!list_empty(&ctx->run_list)) {
                /* drain the run list */
                while (__aio_run_iocbs(ctx))
                        ;
        }
+#endif
        spin_unlock_irq(&ctx->ctx_lock);
        aio_put_req(req);       /* drop extra ref to req */
        return 0;
index eb597d3931d69e30190e5aa35c46979ecab26430..4fffb32ba3a71e1e587bc2be0b888bd29a04921a 100644 (file)
@@ -548,6 +548,8 @@ int wait_on_page_bit_async(struct page *page, int bit_nr,
                                                        TASK_UNINTERRUPTIBLE);
        }
 
+       if (ret)
+               printk("%s: ret=%d\n", __FUNCTION__, ret);
        return ret;
 }
 EXPORT_SYMBOL(wait_on_page_bit_async);
@@ -1017,6 +1019,7 @@ static void do_generic_file_read(struct file *filp, loff_t *ppos,
        pgoff_t last_index;
        pgoff_t prev_index;
        unsigned long offset;      /* offset into pagecache page */
+       unsigned long foo;
        unsigned int prev_offset;
        int error;
 
@@ -1033,6 +1036,7 @@ static void do_generic_file_read(struct file *filp, loff_t *ppos,
                unsigned long nr, ret;
 
                cond_resched();
+               foo = index;
 find_page:
                page = find_get_page(mapping, index);
                if (!page) {
@@ -1126,8 +1130,10 @@ page_ok:
 page_not_up_to_date:
                /* Get exclusive access to the page ... */
                error = lock_page_async(page, current->io_wait);
-               if (unlikely(error))
+               if (unlikely(error)) {
+                       //WARN(1, "%s: %d on index %lu, page %p\n", current->comm, error, foo, page);
                        goto readpage_error;
+               }
 
 page_not_up_to_date_locked:
                /* Did it get truncated before we got the lock? */