diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-08-08 12:39:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-17 09:22:15 -0700 |
commit | 3fecf9a20b3c7dba412339d56d6ec3f2eac12345 (patch) | |
tree | df90b5d048326248454c72fea0dc80bdbad506d4 /mm/filemap.c | |
parent | 4156d121fa7b6840a992ccbfa9ea4170a67bb12c (diff) |
__generic_file_write_iter(): fix handling of sync error after DIO
commit 60bb45297f7551833346c5cebc6d483ea17ea5f2 upstream.
If DIO results in short write and sync write fails, we want to bugger off
whether the DIO part has written anything or not; the logics on the return
will take care of the right return value.
Reported-by: Anton Altaparmakov <aia21@cam.ac.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 900edfaf6df5..8163e0439493 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2584,7 +2584,7 @@ ssize_t __generic_file_write_iter(struct kiocb *iocb, struct iov_iter *from) * that this differs from normal direct-io semantics, which * will return -EFOO even if some bytes were written. */ - if (unlikely(status < 0) && !written) { + if (unlikely(status < 0)) { err = status; goto out; } |