Skip to content

Commit 944dd22

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: compress: fix to update isize when overwriting compressed file
We missed to update isize of compressed file in write_end() with below case: cluster size is 16KB - write 14KB data from offset 0 - overwrite 16KB data from offset 0 Fixes: 4c8ff70 ("f2fs: support data compression") Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent a87aff1 commit 944dd22

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/f2fs/data.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3470,6 +3470,10 @@ static int f2fs_write_end(struct file *file,
34703470
if (f2fs_compressed_file(inode) && fsdata) {
34713471
f2fs_compress_write_end(inode, fsdata, page->index, copied);
34723472
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
3473+
3474+
if (pos + copied > i_size_read(inode) &&
3475+
!f2fs_verity_in_progress(inode))
3476+
f2fs_i_size_write(inode, pos + copied);
34733477
return copied;
34743478
}
34753479
#endif

0 commit comments

Comments
 (0)