Re: [PATCH v3 1/2] fuse: zero the partial EOF page when extending a file

Miklos Szeredi <[email protected]>
Newsgroups dev.linux.lists.fuse-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
Message-ID <CAJfpegtZQZ+c+Sz-tm144xKXuwLNTTOSHHbSWULwqQGkREMCHw@mail.gmail.com>
On Thu, 20 Aug 2026 at 14:36, Jimmy Zuber <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.