summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2019-10-29 10:39:20 +0000
committerJoe Thornber <ejt@redhat.com>2020-01-16 14:58:28 +0000
commit6370c20d392fb6228273695cd9f1a2ae43ff1e77 (patch)
treee7fd8fc6c66fe17350e37f72192a25636e6b8997
parent056eb0a8809aee3ca888aff4fe8e22bf8884a0cc (diff)
downloadlvm2-6370c20d392fb6228273695cd9f1a2ae43ff1e77.tar.gz
[bcache] pass up the error from io_submit rather than using generic -EIO
Author: Heming Zhao
-rw-r--r--lib/device/bcache.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index 72cc59929..56e3db33f 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -246,6 +246,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;
}
@@ -784,8 +788,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;
}
}