unp_connect() may use a shared lock on the vnode to fetch the socket.

Suggested by:	jhb
Reviewed by:	jhb, kib, rwatson
MFC after:	2 weeks
This commit is contained in:
Mikolaj Golub 2012-02-21 19:40:13 +00:00
parent f62f6c88ee
commit a95852edf3

View File

@ -1273,8 +1273,8 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
UNP_PCB_UNLOCK(unp);
sa = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK);
NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | LOCKLEAF, UIO_SYSSPACE, buf,
td);
NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | LOCKSHARED | LOCKLEAF,
UIO_SYSSPACE, buf, td);
error = namei(&nd);
if (error)
vp = NULL;