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>
This commit is contained in:
Nikhilesh Reddy 2015-08-20 17:39:21 -07:00 committed by Sahitya Tummala
parent 560b41b905
commit 89f9247100
1 changed files with 1 additions and 1 deletions

View File

@ -411,7 +411,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;