aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikhilesh Reddy <reddyn@codeaurora.org>2015-08-20 17:39:21 -0700
committerMoyster <oysterized@gmail.com>2016-09-10 12:02:54 +0200
commit1f923c2b53b44331b987b3fe30c3c6c519a334bf (patch)
tree5411fd258915af6a370576d54a143456b8c3b4c0
parent086f2ab64303453750b59e47e168ae6e4a7adb72 (diff)
fs: Workaround the compiler's bad optimization
When compiling the kernel with the compiler "aarch64-linux-android-gcc (GCC) 4.9.x-google 20140827 (prerelease)" The compiler seems to be optimizing a value out in the do_sync_write function and is incorrectly passing the pointer instead of the dereferenced value. Force the compiler to use the right value by passing the dereferenced pointer instead of another variable that is assigned with the dereferenced value. Change-Id: I60505ffe39393f6323dcc7c6f912c74ea6aca6cd Signed-off-by: Nikhilesh Reddy <reddyn@codeaurora.org>
-rw-r--r--fs/read_write.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index f6b7c600e..559d4ed7d 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -391,7 +391,7 @@ ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, lof
kiocb.ki_left = len;
kiocb.ki_nbytes = len;
- ret = filp->f_op->aio_write(&kiocb, &iov, 1, kiocb.ki_pos);
+ ret = filp->f_op->aio_write(&kiocb, &iov, 1, *ppos);
if (-EIOCBQUEUED == ret)
ret = wait_on_sync_kiocb(&kiocb);
*ppos = kiocb.ki_pos;