mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Be a bit more assertive about vnode bypass.
This commit is contained in:
parent
2010c542b2
commit
2a9e0c3216
1 changed files with 17 additions and 16 deletions
|
|
@ -811,23 +811,24 @@ devfs_open(ap)
|
|||
if (error)
|
||||
return (error);
|
||||
|
||||
if (ap->a_fdidx >= 0) {
|
||||
/*
|
||||
* This is a pretty disgustingly long chain, but I am not
|
||||
* sure there is any better way. Passing the fdidx into
|
||||
* VOP_OPEN() offers us more information than just passing
|
||||
* the file *.
|
||||
*/
|
||||
fp = ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx];
|
||||
if (fp->f_ops == &badfileops) {
|
||||
#if 0
|
||||
printf("devfs_open(%s)\n", devtoname(dev));
|
||||
#if 0 /* /dev/console */
|
||||
KASSERT(ap->a_fdidx >= 0,
|
||||
("Could not vnode bypass device on fd %d", ap->a_fdidx));
|
||||
#else
|
||||
if(ap->a_fdidx < 0)
|
||||
return (error);
|
||||
#endif
|
||||
fp->f_ops = &devfs_ops_f;
|
||||
fp->f_data = dev;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a pretty disgustingly long chain, but I am not
|
||||
* sure there is any better way. Passing the fdidx into
|
||||
* VOP_OPEN() offers us more information than just passing
|
||||
* the file *.
|
||||
*/
|
||||
fp = ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx];
|
||||
KASSERT(fp->f_ops == &badfileops,
|
||||
("Could not vnode bypass device on fdops %p", fp->f_ops));
|
||||
fp->f_ops = &devfs_ops_f;
|
||||
fp->f_data = dev;
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue