summaryrefslogtreecommitdiff
path: root/linux/blkdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/blkdev.c')
-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);