Re: [PATCH v3 2/9] mm: limit pagecache folio refcount when splicing into pipes

From: Linus Torvalds

Date: Thu Nov 12 2026 - 14:13:37 EST


On Thu, 12 Nov 2026 at 06:31, David Hildenbrand (Arm) <david@xxxxxxxxxx> wrote:
>
> On 11/12/26 15:00, Pedro Falcato wrote:
> >
> > ETOOMANYREFS I think is good, also EBUSY, EMLINK (though this would be weird)
> > or even a generic -EIO.
>
> So I used EFAULT because that's also what we currently return when
> generic_pipe_buf_get() fails through pipe_buf_get() in splice_pipe_to_pipe() and
> link_pipe().

Yes. It's not a very intuitive error code, I admit, but:

(a) it *is* the error code we already use

(b) it is a fairly unique error code that isn't normal (ie EINVAL etc
that can happen for multiple reasons)

(c) this is something that nobody should EVER EVER test for anyway

IOW, the actual error code doesn't matter. Nobody sane will ever care.
Some of them may be entirely unreachable due to resource allocation
issues. And we already use EFAULT for random historical reasons.

Linus