Re: [PATCH 1/6] kernfs: create vm_operations_struct without page_mkwrite()
From: Christoph Hellwig
Date: Fri Jun 07 2024 - 01:03:53 EST
On Thu, Jun 06, 2024 at 10:54:06PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Jun 05, 2024 at 01:29:29PM -0600, Martin Oliveira wrote:
> > The standard kernfs vm_ops installs a page_mkwrite() operator which
> > modifies the file update time on write.
> >
> > This not always required (or makes sense), such as in the P2PDMA, which
> > uses the sysfs file as an allocator from userspace.
>
> That's not a good idea, please don't do that. sysfs binary files are
> "pass through", why would you want to use this as an allocator?
I think the real question is why sysfs binary files implement
page_mkwrite by default. page_mkwrite is needed for file systems that
need to allocate space from a free space pool, which seems odd for
sysfs.