summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-08-08 18:39:16 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2014-08-11 18:27:40 +0200
commit60bb45297f7551833346c5cebc6d483ea17ea5f2 (patch)
treefc2e8ba9515c9df6a651536b3cc00f4256f97852 /mm
parentswitch iov_iter_get_pages() to passing maximal number of pages (diff)
downloadlinux-60bb45297f7551833346c5cebc6d483ea17ea5f2.tar.xz
linux-60bb45297f7551833346c5cebc6d483ea17ea5f2.zip
__generic_file_write_iter(): fix handling of sync error after DIO
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. Cc: stable@vger.kernel.org [3.16] Reported-by: Anton Altaparmakov <aia21@cam.ac.uk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c2
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;
}