fixes and debug
authorJens Axboe <jens.axboe@oracle.com>
Wed, 14 Jan 2009 19:36:44 +0000 (20:36 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Sat, 26 Sep 2009 15:36:08 +0000 (17:36 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/buffer.c
fs/nfs/pagelist.c
include/linux/pagemap.h
include/linux/wait.h
net/sunrpc/sched.c

index 02e2d02ac0c8edfd83ece51ecdd29d8e4fd91cf2..9bbae13011cef9069fb33ae4c41f603a9e76de84 100644 (file)
@@ -1923,8 +1923,10 @@ static int __block_prepare_write(struct inode *inode, struct page *page,
                int ret;
 
                ret = wait_on_buffer_async(*--wait_bh, current->io_wait);
-               if (ret && !err)
+               if (ret && !err) {
+                       WARN(1, "%s: ret\n", __FUNCTION__);
                        err = ret;
+               }
                if (!buffer_uptodate(*wait_bh))
                        err = -EIO;
        }
@@ -2596,8 +2598,10 @@ int nobh_write_begin(struct file *file, struct address_space *mapping,
                        int err;
        
                        err = wait_on_buffer_async(bh, current->io_wait);
-                       if (err && !ret)
+                       if (err && !ret) {
+                               WARN(1, "%s: ret\n", __FUNCTION__);
                                ret = err;
+                       }
                        if (!buffer_uptodate(bh))
                                ret = -EIO;
                }
@@ -2859,6 +2863,10 @@ int block_truncate_page(struct address_space *mapping,
        if (!buffer_uptodate(bh) && !buffer_delay(bh) && !buffer_unwritten(bh)) {
                ll_rw_block(READ, 1, &bh);
                err = wait_on_buffer_async(bh, current->io_wait);
+               if (err) {
+                       WARN(1, "err=%d\n", err);
+                       goto out;
+               }
                /* Uhhuh. Read error. Complain and punt. */
                err = -EIO;
                if (!buffer_uptodate(bh))
@@ -3361,8 +3369,10 @@ int bh_submit_read(struct buffer_head *bh)
        get_bh(bh);
        bh->b_end_io = end_buffer_read_sync;
        submit_bh(READ, bh);
-       if (wait_on_buffer_async(bh, current->io_wait))
+       if (wait_on_buffer_async(bh, current->io_wait)) {
+               WARN(1, "%s: err\n", __FUNCTION__);
                return -EIOCBRETRY;
+       }
        if (buffer_uptodate(bh))
                return 0;
        return -EIO;
index e2975939126abe4b949e3e7f0d09f8790ba81260..cbf2e49b5b3eaaef49ab84df0fd029ffe5ac88ba 100644 (file)
@@ -191,7 +191,7 @@ nfs_wait_on_request(struct nfs_page *req)
        if (!test_bit(PG_BUSY, &req->wb_flags))
                goto out;
        ret = out_of_line_wait_on_bit(&req->wb_flags, PG_BUSY,
-                       nfs_wait_bit_killable, TASK_KILLABLE);
+                       nfs_wait_bit_killable, TASK_KILLABLE, NULL);
 out:
        return ret;
 }
index 4fe31627fc57d7016a9ea6af834ff85de562c3c0..3c80f3a45688e2a3dce6e03d8accf80aeef6dd69 100644 (file)
@@ -348,7 +348,7 @@ static inline int lock_page_async(struct page *page, struct wait_bit_queue *wq)
  */
 static inline void lock_page(struct page *page)
 {
-       WARN_ON(current->io_wait);
+       WARN_ON(in_aio(current));
        lock_page_async(page, NULL);
 }
 
index 7f1205637f2fbca927514d0f39bd2460951869e1..f2699c76cafb730642e62b1581efba1af2826264 100644 (file)
@@ -416,7 +416,7 @@ static inline int is_sync_wait_bit_queue(struct wait_bit_queue *wq)
        return 1;
 }
 
-#define in_aio(tsk)    is_sync_wait_bit_queue((tsk)->io_wait)
+#define in_aio(tsk)    !is_sync_wait_bit_queue((tsk)->io_wait)
 
 /*
  * Must be called with the spinlock in the wait_queue_head_t held.
index cef74ba0666c2c7cab9a755a29c8ce5985a5dde7..68a232968853e336d3ea5cb6aae076b08150fe08 100644 (file)
@@ -669,7 +669,7 @@ static void __rpc_execute(struct rpc_task *task)
                dprintk("RPC: %5u sync task going to sleep\n", task->tk_pid);
                status = out_of_line_wait_on_bit(&task->tk_runstate,
                                RPC_TASK_QUEUED, rpc_wait_bit_killable,
-                               TASK_KILLABLE);
+                               TASK_KILLABLE, NULL);
                if (status == -ERESTARTSYS) {
                        /*
                         * When a sync task receives a signal, it exits with