summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-03-01 01:45:15 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2017-03-08 02:34:33 -0900
commit06b73dbd7ffc0296b2ecea8d3bc55bfeb72d7f2a (patch)
tree1ba37985a18eb2d9a9616ee160c82339e23e2160 /linux
parent171ee48e57be78f4e95954c99851553fa523bf91 (diff)
Diffstat (limited to 'linux')
-rw-r--r--linux/blkdev.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/linux/blkdev.c b/linux/blkdev.c
index 0bae9b0..f50a9c7 100644
--- a/linux/blkdev.c
+++ b/linux/blkdev.c
@@ -49,6 +49,12 @@ int submit_bio_wait(struct bio *bio)
BUG();
}
+ if (ret != bio->bi_iter.bi_size) {
+ fprintf(stderr, "IO error: %i (%s)\n",
+ ret, strerror(errno));
+ return -EIO;
+ }
+
if (bio->bi_opf & REQ_FUA)
fdatasync(bio->bi_bdev->bd_fd);