Re: [PATCH 2/2] pipe: Fix missing mask update after pipe_wait()

From: Linus Torvalds
Date: Thu Dec 05 2019 - 12:41:11 EST


On Thu, Dec 5, 2019 at 9:22 AM David Howells <dhowells@xxxxxxxxxx> wrote:
>
> Fix pipe_write() to regenerate the ring index mask and update max_usage
> after calling pipe_wait().

Honestly, just remove the "mask" and "max_usage" caching. There are no
advantages to it. With all the function calls etc, it will just result
in moving the data from the pipe to a stack slot anyway.

Maybe you can cache it inside the inner loops or something, but
caching it at the outer level is pointless, and leads to these kinds
of bugs.

Linus