don't initialize the mutex in the temporary struct file, the soo_*
functions just grab f_data and don't muck with anything else so this should be ok. this fixes a panic with invariants where it thinks we've doubly initialized the filetmp mutex even though all we've done is neglect to bzero it.
This commit is contained in:
parent
117f61374c
commit
3fc6a31403
@ -349,8 +349,6 @@ fifo_ioctl(ap)
|
||||
|
||||
if (ap->a_command == FIONBIO)
|
||||
return (0);
|
||||
mtx_init(&filetmp.f_mtx, "struct file", MTX_DEF);
|
||||
filetmp.f_count = 1;
|
||||
if (ap->a_fflag & FREAD) {
|
||||
/* filetmp is local, hence not need be locked. */
|
||||
filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_readsock;
|
||||
@ -366,7 +364,6 @@ fifo_ioctl(ap)
|
||||
goto err;
|
||||
}
|
||||
err:
|
||||
mtx_destroy(&filetmp.f_mtx);
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -466,8 +463,6 @@ fifo_poll(ap)
|
||||
struct file filetmp;
|
||||
int revents = 0;
|
||||
|
||||
mtx_init(&filetmp.f_mtx, "struct file", MTX_DEF);
|
||||
filetmp.f_count = 1;
|
||||
if (ap->a_events & (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND)) {
|
||||
filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_readsock;
|
||||
if (filetmp.f_data)
|
||||
@ -480,7 +475,6 @@ fifo_poll(ap)
|
||||
revents |= soo_poll(&filetmp, ap->a_events, ap->a_cred,
|
||||
ap->a_td);
|
||||
}
|
||||
mtx_destroy(&filetmp.f_mtx);
|
||||
return (revents);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user