On Tue 24-09-24 16:11:08, Zhang Yi wrote: > On 2024/9/23 16:54, Jan Kara wrote: > > On Wed 04-09-24 14:29:25, Zhang Yi wrote: > > Also the range is wrong for collapse > > and insert range. There we need to writeout data upto the EOF because we > > truncate it below. > > > > For collapse and insert range, I passed the length LLONG_MAX, which is > the same as before, this should've upto the EOF, so I think it's > right, or am I missing something? > > ext4_collapse_range(): > > - start = round_down(offset, PAGE_SIZE); > - /* Write out all dirty pages */ > - ret = filemap_write_and_wait_range(mapping, start, LLONG_MAX); > + ret = ext4_prepare_falloc(file, round_down(offset, PAGE_SIZE), > + LLONG_MAX, FALLOC_FL_COLLAPSE_RANGE); > > > ext4_insert_range(): > > - start = round_down(offset, PAGE_SIZE); > - /* Write out all dirty pages */ > - ret = filemap_write_and_wait_range(mapping, start, LLONG_MAX); > + ret = ext4_prepare_falloc(file, round_down(offset, PAGE_SIZE), > + LLONG_MAX, FALLOC_FL_INSERT_RANGE); > Ah sorry, I've missed these bits. So we should be fine. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR