[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFx8hPMx033K6E1Jz0zjx0uM0g_h-Un=mGyQMfWW-7w4fw@mail.gmail.com>
Date: Fri, 13 Jan 2017 12:08:44 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: "Alan J. Wylie" <alan@...ie.me.uk>,
Thorsten Leemhuis <regressions@...mhuis.info>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: 4.9.0 regression in pipe-backed iov_iter with systemd-nspawn
On Fri, Jan 13, 2017 at 11:33 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> This function looks so broken that I must be missing something. Why
> doesn't pipe_advance() just look like the following:
>
> static void pipe_advance(struct iov_iter *i, size_t size)
> {
...
> pipe_buf_release(pipe, buf);
> pipe->nrbufs--;
...
I think this part needs to update "curbufs" too, so something like
pipe->curbuf = (pipe->curbuf + 1) & (pipe->buffers - 1);
although I think that "idx" has to track curbuf here anyway, so I
guess it could just be combined with the idx update and look something
like
pipe->curbuf = idx = next_idx(idx, pipe);
in there. Otherwise we get out of sync with the pipe state.
Or maybe I'm just full of it.
Linus
Powered by blists - more mailing lists