@@ -100,6 +100,10 @@ ssize_t iomap_dio_complete(struct iomap_dio *dio)
if (dops && dops->end_io)
ret = dops->end_io(iocb, dio->size, ret, dio->flags);
+ if (dio->error && dops && dops->ioerror)
+ dops->ioerror(file_inode(iocb->ki_filp),
+ (dio->flags & IOMAP_DIO_WRITE) ? WRITE : READ,
+ offset, dio->size, dio->error);
if (likely(!ret)) {
ret = dio->size;
@@ -439,6 +439,8 @@ struct iomap_dio_ops {
unsigned flags);
void (*submit_io)(const struct iomap_iter *iter, struct bio *bio,
loff_t file_offset);
+ void (*ioerror)(struct inode *inode, int direction, loff_t pos,
+ u64 len, int error);
/*
* Filesystems wishing to attach private information to a direct io bio