From 9a1d09867c25518617487fc5f8b8eb4349d26973 Mon Sep 17 00:00:00 2001 From: "Chen, Kenneth W" Date: Sat, 25 Mar 2006 03:08:16 -0800 Subject: [PATCH] --- yaml --- r: 23604 b: refs/heads/master c: 174e27c607cfa3ebb92934d28c0fdfcf5ce6c3af h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/direct-io.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 66a494ce9c1d..811583372910 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0e6b3e5e97e2e8a25bcfc528dad94edf5220dfeb +refs/heads/master: 174e27c607cfa3ebb92934d28c0fdfcf5ce6c3af diff --git a/trunk/fs/direct-io.c b/trunk/fs/direct-io.c index 27f3e787faca..235ed8d1f11e 100644 --- a/trunk/fs/direct-io.c +++ b/trunk/fs/direct-io.c @@ -129,6 +129,7 @@ struct dio { /* AIO related stuff */ struct kiocb *iocb; /* kiocb */ int is_async; /* is IO async ? */ + int io_error; /* IO error in completion path */ ssize_t result; /* IO result */ }; @@ -250,6 +251,10 @@ static void finished_one_bio(struct dio *dio) ((offset + transferred) > dio->i_size)) transferred = dio->i_size - offset; + /* check for error in completion path */ + if (dio->io_error) + transferred = dio->io_error; + dio_complete(dio, offset, transferred); /* Complete AIO later if falling back to buffered i/o */ @@ -406,7 +411,7 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio) int page_no; if (!uptodate) - dio->result = -EIO; + dio->io_error = -EIO; if (dio->is_async && dio->rw == READ) { bio_check_pages_dirty(bio); /* transfers ownership */ @@ -971,6 +976,7 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode, dio->next_block_for_io = -1; dio->page_errors = 0; + dio->io_error = 0; dio->result = 0; dio->iocb = iocb; dio->i_size = i_size_read(inode);