Re: [RFA][PATCH 1/8] seq_file: Rename seq_overflow() to seq_has_overflowed() and make public

From: Steven Rostedt
Date: Wed Oct 29 2014 - 20:20:57 EST


On Wed, 29 Oct 2014 15:08:36 -0700
Joe Perches <joe@xxxxxxxxxxx> wrote:

> On Wed, 2014-10-29 at 17:56 -0400, Steven Rostedt wrote:
> > +A true return from seq_has_overflowed means that the seq_file buffer is full
> > +and further output will be discarded.
>
> Perhaps the description is a bit unclear here.
>
> Doesn't a return of true to seq_has_overflowed mean that
> more characters have already been written than the buffer
> can accept?
>

Actually, come to think about it. It really doesn't matter. As if it is
"full" or overflowed, the buffer currently gets discarded regardless.
Thus, it could mean that the buffer was already overflowed. Because the
current logic is full == overflowed. Really, a full buffer is a buffer
with all but one byte left used. If size == len, then it has indeed
overflowed.

That is what my other patch changes.

I'll change the comment about that.

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/