Re: [PATCH] tty proc bugfix [was RE: Linux 2.2.15pre19]

From: Andrea Arcangeli (andrea@suse.de)
Date: Fri Apr 21 2000 - 07:56:23 EST


On Fri, 21 Apr 2000, Manfred Spraul wrote:

>* ~ 12 drivers are affected.
>* "*start = page + (begin-off)" is very common, most proc functions use
>that
>* I tried your patch, "dd bs=1" and "dd bs=1024" doesn't match.

To read it right you have to use a buffer that is longer the maximal
length of one line. Otherwise lines will be truncated. A buffer of 80
chars is enough.

>* quite many proc functions don't support "bs=1" properly.

Each case should be considered separately. If the output won't risk to
grow over a pagesize then the old approch is ok with the fix applied.

>What if someone shares /proc over the network? We can support llseek,
>the overhead is negligible. IMHO we should do that.

We support lseek but the offset is not in bytes but in lines ;).

Also consider that if the state of the serial line changes from under you
(between the two small reads) then the absolute offset will change and
you'll break anyway (my patch won't break instead).

Andrea

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



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:18 EST