[Home]

Summary:ASTERISK-02045: /proc/zaptel/xxx doesn't work properly under Linux 2.6
Reporter:steveu (steveu)Labels:
Date Opened:2004-07-17 14:50:07Date Closed:2008-06-07 10:43:50
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:The code to generate the /proc/zaptel/xxx pages assumes it can write a whole page in one go. This works with Linux 2.4. However, Linux 2.6 can only accept 1024 bytes per write from a kernel module. The page an E1 with all the channels configured and some errors showing exceeds 1024 bytes, and the end gets chopped of.

The off and count parameters to zaptel_proc_read need to be used to get this right. However, getting things right with changing data would be a a pain. Ensuring pages never exceed 1024 bytes might be easier in the short term. Changing ClearChannel to CC did it for me as a temp. measure.
Comments:By: Olle Johansson (oej) 2004-07-22 05:19:15

Which version of zaptel code?
Which distribution?

By: steveu (steveu) 2004-07-22 05:25:44

Which version of zaptel code?
   Any version. The /proc hasn't changed much, and always could exceed 1024 bytes.
Which distribution?
   Anything with a 2.6 kernel

By: Mark Spencer (markster) 2004-07-22 20:45:22

What about changing ClearChannel to Clear is that good enough?

By: steveu (steveu) 2004-07-23 22:49:48

I have changed ClearChannel to CC in my own copy, and that seems OK, even with all the possible error information displayed. I think "Clear" is probably short enough too. The longest write I was getting before was about 1200 bytes. 30*" Channel" is 240 bytes, so I guess it will still come a little under 1024 bytes. Its a bit marginal though. Adding a bit fat notice in the source to say "DON'T LET THIS GO BEYOND 1024 BYTES" might be a good thing for future maintainers.

This is something of a PITA change in Linux. 2.4 allowed 4K in one write, which is enough for a complete screenful, and good enough for almost any use of a /proc file.

By: Mark Spencer (markster) 2004-07-23 23:11:14

Okies, fixed in CVS, including the warning.

By: Digium Subversion (svnbot) 2008-06-07 10:43:50

Repository: dahdi
Revision: 438

U   trunk/zaptel.c

------------------------------------------------------------------------
r438 | markster | 2008-06-07 10:43:49 -0500 (Sat, 07 Jun 2008) | 2 lines

Make things fit in < 1024 (bug ASTERISK-2045)

------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=438