Whamcloud - gitweb
LU-3044 llite: LSeek SEEK_CUR incorrect after O_APPEND write
When a file is opened with O_APPEND set and a write is done,
the file offset value immediately after the write is incorrect.
It is too much by approximately the length of the write.
This can be seen by doing lseek SEEK_CUR immediately after the
write. This does not cause corruption on subsequent writes
because with O_APPEND VFS resets the file offset to EOF before
each write.
This is resolved by removing the change made for BUG:17711,
which was to set crw_pos in ll_prepare_write.
That change was to pass the LASSERT(cl_page_in_io(page, io)) in
cl_io_prepare_write(). However, this assert has since been
modified to exclude the O_APPEND case, making this unnecessary.
crw_pos is also updated in cl_io_rw_advance which is why pos is
greater than expected.
Removing the extra update to crw_pos in ll_prepare_write fixes
this.
Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: I7c1ad10eefec44aae415b8cfce6b01bc9b39fc8f
Reviewed-on: http://review.whamcloud.com/5861
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>