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:
parent
455fb174df
commit
3a54d6a8a8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131532
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user