Re: [PATCH v2 10/10] ext4: factor out a common helper to lock and flush data before fallocate
From: Jan Kara
Date: Tue Sep 24 2024 - 06:06:30 EST
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