Change M_WAITOK argument to sodupsockaddr() to M_NOWAIT. When the call

to dup_sockaddr() was renamed to sodupsockaddr(), the argument was
changed from '1' to 'M_WAITOK', which changed the semantics.  This
resulted in a WITNESS warning about a potential sleep while holding the
NFS server mutex.  Now this will no longer happen, restoring a possible
bug present in the original code (setting RC_NAM even though the malloc
to copy the addres may fail).  bde observes that the flag names here
should probably not be the same as the malloc flags for name space
reasons.

Bumped into by:	kuriyama
This commit is contained in:
rwatson 2004-07-03 19:17:06 +00:00
parent 560e5d06b5
commit e617a5fdaa

View File

@ -248,8 +248,12 @@ nfsrv_getcache(struct nfsrv_descript *nd, struct mbuf **repp)
/* case AF_INET6: */
/* case AF_ISO: */
default:
/*
* XXXRW: Seems like we should only set RC_NAM if we
* actually manage to set rc_nam to something non-NULL.
*/
rp->rc_flag |= RC_NAM;
rp->rc_nam = sodupsockaddr(nd->nd_nam, M_WAITOK);
rp->rc_nam = sodupsockaddr(nd->nd_nam, M_NOWAIT);
break;
};
rp->rc_proc = nd->nd_procnum;