Re: [PATCH v3 1/2] fuse: zero the partial EOF page when extending a file
From: Miklos Szeredi
Date: Mon Aug 24 2026 - 09:16:16 EST
On Thu, 20 Aug 2026 at 14:36, Jimmy Zuber <jamz@xxxxxxxxxx> wrote:
> +void fuse_zero_partial_eof_folio(struct inode *inode, loff_t from, loff_t to)
> +{
> + struct folio *folio;
> + size_t offset, end;
> +
> + if (from >= to)
> + return;
> +
> + folio = filemap_lock_folio(inode->i_mapping, from >> PAGE_SHIFT);
How about:
truncate_pagecache_range(inode, from, to - 1);
?
The mkclean/mark_dirty magic is only needed by filesystems using
buffer heads, as Jan pointed out. The other parts of the zeroing are
done by the above helper.
Thanks,
Miklos