Hi.
I got problem with namei(9) and some devices.
Example (catching syscall open()):
static int
n_open(register struct proc *p, register struct open_args *ea)
{
[...]
long finode = 0;
struct nameidata nd, *ndptr;
[...]
ndptr = &nd;
NDINIT(ndptr, LOOKUP, FOLLOW | SAVENAME, UIO_USERSPACE, ea->path, p);
if (!namei(ndptr))
if (!VOP_GETATTR(ndptr->ni_vp, &va, p->p_ucred, p))
finode = va.va_fileid;
[...]
}
I use namei() coz i want file inode.
But when namei() will be called some devices are blocking.
For example if I do in this way:
[...]
return open(p, ea);
if (!namei(ndptr))
[...]
Everything is oke, but:
namei(ndptr)
return open(p, ea);
isn't.
% mpg123 some.mp3
Can't open /dev/dsp!
And /dev/dsp is completely fucked up, it is still busy even if I unload my
module. Only reboot can free it.
So what's going on?
Or maybe there is some other way to get file inode?
--
Paweł Jakub Dawidek
Network Administrator.
Am I Evil? Yes, I Am.
msg31729/pgp00000.pgp
Description: PGP signature

