summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver/nfs_srvcache.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-07-03 19:17:06 +0000
committerrwatson <rwatson@FreeBSD.org>2004-07-03 19:17:06 +0000
commit525cc9604d55ff5bc33bcd5963d4ef70ad3e5f9a (patch)
tree4972a7c352f38da1fe4206f1e3c1ef0d6d1d07b3 /sys/nfsserver/nfs_srvcache.c
parentac606e7e88ac864370ce2f0473cba94dd5482314 (diff)
downloadFreeBSD-src-525cc9604d55ff5bc33bcd5963d4ef70ad3e5f9a.zip
FreeBSD-src-525cc9604d55ff5bc33bcd5963d4ef70ad3e5f9a.tar.gz
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
Diffstat (limited to 'sys/nfsserver/nfs_srvcache.c')
-rw-r--r--sys/nfsserver/nfs_srvcache.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/nfsserver/nfs_srvcache.c b/sys/nfsserver/nfs_srvcache.c
index e82625e..b41942d 100644
--- a/sys/nfsserver/nfs_srvcache.c
+++ b/sys/nfsserver/nfs_srvcache.c
@@ -248,8 +248,12 @@ loop:
/* 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;
OpenPOWER on IntegriCloud