]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.16.3/__generic_file_write_iter-fix-handling-of-sync-error-after-dio.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.3 / __generic_file_write_iter-fix-handling-of-sync-error-after-dio.patch
CommitLineData
8b77cbea
GKH
1From 60bb45297f7551833346c5cebc6d483ea17ea5f2 Mon Sep 17 00:00:00 2001
2From: Al Viro <viro@zeniv.linux.org.uk>
3Date: Fri, 8 Aug 2014 12:39:16 -0400
4Subject: __generic_file_write_iter(): fix handling of sync error after DIO
5
6From: Al Viro <viro@zeniv.linux.org.uk>
7
8commit 60bb45297f7551833346c5cebc6d483ea17ea5f2 upstream.
9
10If DIO results in short write and sync write fails, we want to bugger off
11whether the DIO part has written anything or not; the logics on the return
12will take care of the right return value.
13
14Reported-by: Anton Altaparmakov <aia21@cam.ac.uk>
15Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17
18---
19 mm/filemap.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22--- a/mm/filemap.c
23+++ b/mm/filemap.c
24@@ -2584,7 +2584,7 @@ ssize_t __generic_file_write_iter(struct
25 * that this differs from normal direct-io semantics, which
26 * will return -EFOO even if some bytes were written.
27 */
28- if (unlikely(status < 0) && !written) {
29+ if (unlikely(status < 0)) {
30 err = status;
31 goto out;
32 }