Second attempt at a work-around for fifo-related socket panics during
make -j with high levels of parallelism: acquire Giant in fifo I/O routines. Discussed with: ups MFC after: 3 days
This commit is contained in:
parent
7bbb3a2690
commit
2affdbee3e
@ -705,7 +705,9 @@ fifo_read_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, str
|
||||
if (uio->uio_resid == 0)
|
||||
return (0);
|
||||
sflags = (fp->f_flag & FNONBLOCK) ? MSG_NBIO : 0;
|
||||
mtx_lock(&Giant);
|
||||
error = soreceive(fip->fi_readsock, NULL, uio, NULL, NULL, &sflags);
|
||||
mtx_unlock(&Giant);
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -725,6 +727,8 @@ fifo_write_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, st
|
||||
fip = fp->f_data;
|
||||
KASSERT(uio->uio_rw == UIO_WRITE,("fifo_write mode"));
|
||||
sflags = (fp->f_flag & FNONBLOCK) ? MSG_NBIO : 0;
|
||||
mtx_lock(&Giant);
|
||||
error = sosend(fip->fi_writesock, NULL, uio, 0, NULL, sflags, td);
|
||||
mtx_unlock(&Giant);
|
||||
return (error);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user