Blaisorblade <[EMAIL PROTECTED]> writes:

> That is not a bad attempt, and you show having some uncommon experience with 
> kernel code. I'm not reviewing it line-by-line - I should check the APIs of 
> VFS calls and usage examples, but I haven't the time.

Cheers. I've never written kernel code before... but how hard can it
be?


> I can only suggest reading the code of sys_getdents as a starting point. I 
> think you could use without problems vfs_readdir instead of ->readdir since 
> it accepts a filldir_t callback and does the needed locking you do
> not do.
>
> You very likely race with process creation and exit - as /proc/<pid> folders 
> appear and disappear you need some kind of locking.

Some of the documentation I found suggested that readdir handled all
this by reading the contents of the directory and then presenting
it... atomic in terms of directory modification.

Your comments suggest that I've got the wrong end of the stick there.

Anyway... I'll try and use vfs_readdir and take a look at doing things
with dentrys.


When I'm rich I'm going to start a linux kernel documentation
project because the current state of the doc of kernel APIs is v.poor.


> PS: this is a recollection of ideas about the crash, but the fix was never 
> completed so consider it as a reasonable approximation of actual
> problems.

Thanks very much for your help.

The thing I find myself needing for kernel hacking is someone to say
"nah... that's the wrong way to do it - go look at x,y and z
instead...". It's good to know that someone here will do that job.


btw I'm also looking at whether I can simply add a proc file for net
device IP addresses. I don't really see why this is not possible given
that the kernel knows this information. It's going to take me a lot
longer to fix that problem though... registering stuff with proc fs is
pretty impenetrable.


-- 
Nic Ferrier
http://www.tapsellferrier.co.uk   for all your tapsell ferrier needs

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to