On Wed, Apr 17, 2019 at 10:04 PM Liu Bo <bo.liu@xxxxxxxxxxxxxxxxx> wrote: > > From: Xiaoguang Wang <xiaoguang.wang@xxxxxxxxxxxxxxxxx> > > If page straddles i_size and we write the whole page, the fuse > user-space filesystem may extend file size, it will confuse users. > > Before this patch: > xfs_io -t -f \ > -c "truncate 5120" \ > -c "pwrite -S 0x58 0 5120" \ > -c "mmap -rw 0 5120" \ > -c "mwrite -S 0x59 2048 3072" \ > -c "close" \ > testfile > testfile's length will be 8192 bytes, with this patch, testfile's > length will be 5120 bytes. Cannot reproduce this. The file size should be cropped in fuse_flush_writepages() and the above test case produces the expected result, so I'm not sure how were you able to get 8192 byte file. Thanks, Miklos