Re: WARNING in iov_iter_revert (2)

From: Al Viro
Date: Sat Feb 20 2021 - 12:46:43 EST


On Sat, Feb 20, 2021 at 08:56:40AM -0800, Linus Torvalds wrote:
> Al,
> This is the "FIXME! Have Al check this!" case in do_tty_write(). You were
> in on that whole discussion, but we never did get to that issue...
>
> There are some subtle rules about doing the iov_iter_revert(), but what's
> the best way to do this properly? Instead of doing a copy_from_iter() and
> then reverting the part that didn't fit in the buffer, doing a
> non-advancing copy and then advancing the amount that did fit, or what?
>
> I still don't have power, so this is all me on mobile with html email
> (sorry), and limited ability to really look closer.
>
> "Help me, Albi-wan Viro, you're my only hope"

Will check... BTW, when you get around to doing pulls, could you pick
the replacement (in followup) instead of the first pull request for
work.namei? Jens has caught a braino in the last commit there...