Re: [PATCH] fs/splice: clamp an over-reported write_iter result

From: Christian Brauner

Date: Tue Nov 10 2026 - 10:32:44 EST


On Thu, Oct 29, 2026 at 07:12:20AM -0700, Cheng Yongkang wrote:
> Commit a3de58b12ce0 ("netfs: Fix unbuffered write error handling")
> added the warning for this condition but only reports it. Clamp the
> return value to the size of the iterator that was actually handed to
> ->write_iter(), so the pipe accounting stays consistent even when a
> producer violates the iterator contract.

The actual bug is probably that proc_sys_call_handler() returning
whatever length the bpf sysctl hook put into count. That's fixed by [1].

I'll probably take this on top.

[1]: https://lore.kernel.org/r/179328314073.648427.7892850166511253762@xxxxxxxxx