mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
This commit is contained in:
parent
36f90b0a2d
commit
187372a3b9
6 changed files with 35 additions and 14 deletions
9
fs/dax.c
9
fs/dax.c
|
|
@ -267,8 +267,13 @@ ssize_t dax_do_io(struct kiocb *iocb, struct inode *inode,
|
|||
if ((flags & DIO_LOCKING) && iov_iter_rw(iter) == READ)
|
||||
inode_unlock(inode);
|
||||
|
||||
if ((retval > 0) && end_io)
|
||||
end_io(iocb, pos, retval, bh.b_private);
|
||||
if (end_io) {
|
||||
int err;
|
||||
|
||||
err = end_io(iocb, pos, retval, bh.b_private);
|
||||
if (err)
|
||||
retval = err;
|
||||
}
|
||||
|
||||
if (!(flags & DIO_SKIP_DIO_COUNT))
|
||||
inode_dio_end(inode);
|
||||
|
|
|
|||
Loading…
Reference in a new issue