]>
Commit | Line | Data |
---|---|---|
8b77cbea GKH |
1 | From 60bb45297f7551833346c5cebc6d483ea17ea5f2 Mon Sep 17 00:00:00 2001 |
2 | From: Al Viro <viro@zeniv.linux.org.uk> | |
3 | Date: Fri, 8 Aug 2014 12:39:16 -0400 | |
4 | Subject: __generic_file_write_iter(): fix handling of sync error after DIO | |
5 | ||
6 | From: Al Viro <viro@zeniv.linux.org.uk> | |
7 | ||
8 | commit 60bb45297f7551833346c5cebc6d483ea17ea5f2 upstream. | |
9 | ||
10 | If DIO results in short write and sync write fails, we want to bugger off | |
11 | whether the DIO part has written anything or not; the logics on the return | |
12 | will take care of the right return value. | |
13 | ||
14 | Reported-by: Anton Altaparmakov <aia21@cam.ac.uk> | |
15 | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> | |
16 | Signed-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 | } |