diff options
author | Christoph Hellwig <hch@lst.de> | 2016-02-08 14:40:51 +1100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-02-08 14:40:51 +1100 |
commit | 187372a3b9faff68ed61c291d0135e6739e0dbdf (patch) | |
tree | 7eeed8ee2944dbdcc60ec49cf08f1b1604400b3e /fs/ocfs2 | |
parent | 36f90b0a2ddd60823fe193a85e60ff1906c2a9b3 (diff) | |
download | op-kernel-dev-187372a3b9faff68ed61c291d0135e6739e0dbdf.zip op-kernel-dev-187372a3b9faff68ed61c291d0135e6739e0dbdf.tar.gz |
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/ocfs2')
-rw-r--r-- | fs/ocfs2/aops.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 794fd15..5dcc5f5 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -620,7 +620,7 @@ bail: * particularly interested in the aio/dio case. We use the rw_lock DLM lock * to protect io on one node from truncation on another. */ -static void ocfs2_dio_end_io(struct kiocb *iocb, +static int ocfs2_dio_end_io(struct kiocb *iocb, loff_t offset, ssize_t bytes, void *private) @@ -628,6 +628,9 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, struct inode *inode = file_inode(iocb->ki_filp); int level; + if (bytes <= 0) + return 0; + /* this io's submitter should not have unlocked this before we could */ BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); @@ -644,6 +647,8 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, level = ocfs2_iocb_rw_locked_level(iocb); ocfs2_rw_unlock(inode, level); } + + return 0; } static int ocfs2_releasepage(struct page *page, gfp_t wait) |