Skip to content

Commit

Permalink
[bcache] pass up the error from io_submit rather than using generic -EIO
Browse files Browse the repository at this point in the history
Author: Heming Zhao
  • Loading branch information
jthornber committed Oct 29, 2019
1 parent 5fdebf9 commit 2b3c39e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/device/bcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ static bool _async_issue(struct io_engine *ioe, enum dir d, int fd,

if (r < 0) {
_cb_free(e->cbs, cb);
((struct block *) context)->error = r;
log_warn("io_submit <%c> off %llu bytes %llu return %d:%s",
(d == DIR_READ) ? 'R' : 'W', (long long unsigned)offset,
(long long unsigned) nbytes, r, strerror(-r));
return false;
}

Expand Down Expand Up @@ -869,8 +873,7 @@ static void _issue_low_level(struct block *b, enum dir d)
dm_list_move(&cache->io_pending, &b->list);

if (!cache->engine->issue(cache->engine, d, b->fd, sb, se, b->data, b)) {
/* FIXME: if io_submit() set an errno, return that instead of EIO? */
_complete_io(b, -EIO);
_complete_io(b, b->error);
return;
}
}
Expand Down

0 comments on commit 2b3c39e

Please sign in to comment.