Re: [PATCH v2 0/2] kernfs, sysfs: refuse splice on /sys/power/resume

From: Tejun Heo

Date: Tue Nov 03 2026 - 11:00:33 EST


Hello, Krystian.

On Tue, Nov 03, 2026 at 03:57:41PM +0100, Krystian Kaniewski wrote:
> Patch 1 adds SYSFS_LOOKUP and kernfs_ops->may_lookup. Writable opens of a
> marked file refuse both splice directions. Their of->mutex and seq_file lock
> use separate classes. Read-only opens retain splice support.

Can we be explicit and name the flag after what it does, e.g.
SYSFS_NO_SPLICE and kernfs_ops->no_splice?

> The new property cannot be combined with mmap or preallocated buffers.
> Kernfs rejects those combinations for direct callers, and sysfs rejects
> SYSFS_LOOKUP together with SYSFS_PREALLOC before selecting operations.
> Binary attributes do not support SYSFS_LOOKUP and reject it at creation.

Can we keep the rest minimal? With /sys/power/resume the only user, I don't
think things like the mmap and prealloc combination checks or the binary
attribute rejections are needed.

Thanks.

--
tejun