mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
[bcache] pass up the error from io_submit rather than using generic -EIO
Author: Heming Zhao
This commit is contained in:
parent
5fdebf9bbf
commit
2b3c39e402
@ -293,6 +293,10 @@ static bool _async_issue(struct io_engine *ioe, enum dir d, int fd,
|
|||||||
|
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
_cb_free(e->cbs, cb);
|
_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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -869,8 +873,7 @@ static void _issue_low_level(struct block *b, enum dir d)
|
|||||||
dm_list_move(&cache->io_pending, &b->list);
|
dm_list_move(&cache->io_pending, &b->list);
|
||||||
|
|
||||||
if (!cache->engine->issue(cache->engine, d, b->fd, sb, se, b->data, b)) {
|
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, b->error);
|
||||||
_complete_io(b, -EIO);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user