fuse: Use iocb->ki_pos instead of pos for shortcircuit writes
Use iocb->ki_pos instead of pos to handle the cases of files that are
opened with O_APPEND. For example if multiple processes open the same
file with O_APPEND then the iocb->ki_pos will not be equal to the new
pos value that is updated with the file size(to guarantee appends even
when the file has grown due to the writes by another process).
We should use iocb->pos here since the lower filesystem is expected to
adjust for O_APPEND anyway and may need to adjust the size for the file
changes that occur due to some processes writing directly to the lower
filesystem.
Change-Id: I279e3ea96cdfd020c45f4cd348f6e1b4bd48a3fb
Signed-off-by:
Nikhilesh Reddy <reddyn@codeaurora.org>
Loading
Please register or sign in to comment