projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
22c6186
)
new_sync_write(): discard ->ki_pos unless the return value is positive
author
Al Viro
<viro@zeniv.linux.org.uk>
Tue, 7 Apr 2015 00:50:38 +0000
(20:50 -0400)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Sun, 12 Apr 2015 02:29:46 +0000
(22:29 -0400)
That allows ->write_iter() instances much more convenient life wrt
iocb->ki_pos (and fixes several filesystems with borderline POSIX
violations when zero-length write succeeds and changes the current
position).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/read_write.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/read_write.c
b/fs/read_write.c
index 45d583c33879e18d89b3fc06d48bbd05a30b6ab3..819ef3faf1bb710678175de06a13f4dcf6e90d62 100644
(file)
--- a/
fs/read_write.c
+++ b/
fs/read_write.c
@@
-477,7
+477,8
@@
static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t
ret = filp->f_op->write_iter(&kiocb, &iter);
BUG_ON(ret == -EIOCBQUEUED);
- *ppos = kiocb.ki_pos;
+ if (ret > 0)
+ *ppos = kiocb.ki_pos;
return ret;
}