Re: [PATCH v2 10/10] ext4: factor out a common helper to lock and flush data before fallocate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux