diff options
author | Christoph Hellwig <hch@lst.de> | 2016-02-07 22:40:51 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-02-07 22:40:51 -0500 |
commit | 187372a3b9faff68ed61c291d0135e6739e0dbdf (patch) | |
tree | 7eeed8ee2944dbdcc60ec49cf08f1b1604400b3e /fs/direct-io.c | |
parent | 36f90b0a2ddd60823fe193a85e60ff1906c2a9b3 (diff) |
direct-io: always call ->end_io if non-NULL
This way we can pass back errors to the file system, and allow for
cleanup required for all direct I/O invocations.
Also allow the ->end_io handlers to return errors on their own, so that
I/O completion errors can be passed on to the callers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/direct-io.c')
-rw-r--r-- | fs/direct-io.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c index 1b2f7ffc8b84..9c6f885cc518 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c | |||
@@ -253,8 +253,13 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, | |||
253 | if (ret == 0) | 253 | if (ret == 0) |
254 | ret = transferred; | 254 | ret = transferred; |
255 | 255 | ||
256 | if (dio->end_io && dio->result) | 256 | if (dio->end_io) { |
257 | dio->end_io(dio->iocb, offset, transferred, dio->private); | 257 | int err; |
258 | |||
259 | err = dio->end_io(dio->iocb, offset, ret, dio->private); | ||
260 | if (err) | ||
261 | ret = err; | ||
262 | } | ||
258 | 263 | ||
259 | if (!(dio->flags & DIO_SKIP_DIO_COUNT)) | 264 | if (!(dio->flags & DIO_SKIP_DIO_COUNT)) |
260 | inode_dio_end(dio->inode); | 265 | inode_dio_end(dio->inode); |