Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea3ce480 authored by Nikhilesh Reddy's avatar Nikhilesh Reddy Committed by Razziell
Browse files

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: default avatarNikhilesh Reddy <reddyn@codeaurora.org>
Signed-off-by: default avatarFrancisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: default avatarHarsh Shandilya <harsh@prjkt.io>
parent 69affeae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -454,7 +454,7 @@ ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, lof
	kiocb.ki_pos = *ppos;
	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;