Possible problem with read()
From: Gerhard W. Gruber (sparhawk_at_gmx.at)
Date: 11/25/03
- Next message: Gerhard W. Gruber: "Re: Forcing a module to unload"
- Previous message: Jitesh K Patil, Systems Engineer, Wipro Technologies.: "Re: Invoking the mknod system call in init_module() - bad idea?"
- In reply to: Måns Rullgård: "Re: Forcing a module to unload"
- Next in thread: Christoph Baumann: "Re: Forcing a module to unload"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 25 Nov 2003 21:08:13 +0100
On Tue, 25 Nov 2003 09:50:47 +0100 wrote mru@kth.se (Måns Rullgård) in
comp.os.linux.development.system with <yw1x4qws96hk.fsf@kth.se>
>Not it the first one has claimed some PCI device or something like
>that.
No. It just tried to load the config file. I don't know why it behaves like
this, but the flow goes like this
init_module()
InitPICE()
LoadConfig()
ParseProfile()
while(ReadFile());
if(error)
return errocode;
exit();
The funny thing is, that as you can see above ReadLine is fully contained in a
loop that loads the configuration data. The actual flow, as I can see in the
log is that LoadConfig() is called which in turn calls ParseProfile which will
use my version of ReadLine to return each individual line of the configfile.
ParseProfile is called as it is expected, but then it seems to return
prematuraly, goes back back with an errorcode to init_module which will exit.
and AFTER that I can see a lot of ReadLine function calls, which all fail
then. There are way to many Readline Traces in the log, there are currently
only about 4 lines in the config file, but I can see at least 20 or 30 and at
the end I can see some kernel crashdump.
Now I wonder why ReadLine is executed after the module is already unloaded.
Could this having something to do with that I use fp->read() and this gets
detached for some reason? It is the only thing that I could think of. But how
can I prevent this?
In your example (Kasper) I read that I only can read in a process context.
Could this be the problem? But then I wonder why the original code worked,
because it never seemd to have this problem.
I also don't see any logical differen between your code and mine. The only
difference I have is that I use a static buffer in the module, while you
allocate one with get_free_page. I checked the file and the open succeeds, so
this is not the issue.
-- Gerhard Gruber Maintainer of SoftICE for Linux - http://sourceforge.net/projects/pice Fast application launcher - http://sourceforge.net/projects/launchmenu
- Next message: Gerhard W. Gruber: "Re: Forcing a module to unload"
- Previous message: Jitesh K Patil, Systems Engineer, Wipro Technologies.: "Re: Invoking the mknod system call in init_module() - bad idea?"
- In reply to: Måns Rullgård: "Re: Forcing a module to unload"
- Next in thread: Christoph Baumann: "Re: Forcing a module to unload"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|