Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23604
b: refs/heads/master
c: 174e27c
h: refs/heads/master
v: v3
  • Loading branch information
Chen, Kenneth W authored and Linus Torvalds committed Mar 25, 2006
1 parent 5fd3939 commit 9a1d098
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e6b3e5e97e2e8a25bcfc528dad94edf5220dfeb
refs/heads/master: 174e27c607cfa3ebb92934d28c0fdfcf5ce6c3af
8 changes: 7 additions & 1 deletion trunk/fs/direct-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
};

Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9a1d098

Please sign in to comment.