aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/portalfs
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2001-11-24 18:28:22 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2001-11-24 18:28:22 +0000
commit0dbd8b1b08a825e7bd18fc07db17853b904d02e2 (patch)
treecefec4ce96d1c28a17e4f8c66a2cc43a02f8daeb /sys/fs/portalfs
parenta02ab1042e15274e9243470d7d8a52216b4b75d0 (diff)
downloadsrc-0dbd8b1b08a825e7bd18fc07db17853b904d02e2.tar.gz
src-0dbd8b1b08a825e7bd18fc07db17853b904d02e2.zip
convert holdsock() to fget(). Add XXX reminder for future socket locking.
Notes
Notes: svn path=/head/; revision=86872
Diffstat (limited to 'sys/fs/portalfs')
-rw-r--r--sys/fs/portalfs/portal_vfsops.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/fs/portalfs/portal_vfsops.c b/sys/fs/portalfs/portal_vfsops.c
index 80356e4e944f..4e7313130e5a 100644
--- a/sys/fs/portalfs/portal_vfsops.c
+++ b/sys/fs/portalfs/portal_vfsops.c
@@ -99,10 +99,13 @@ portal_mount(mp, path, data, ndp, td)
if (error)
return (error);
- error = holdsock(td->td_proc->p_fd, args.pa_socket, &fp);
- if (error)
+ if ((error = fget(td, args.pa_socket, &fp)) != 0)
return (error);
- so = (struct socket *) fp->f_data;
+ if (fp->f_type != DTYPE_SOCKET) {
+ fdrop(fp, td);
+ return(ENOTSOCK);
+ }
+ so = (struct socket *) fp->f_data; /* XXX race against userland */
if (so->so_proto->pr_domain->dom_family != AF_UNIX) {
fdrop(fp, td);
return (ESOCKTNOSUPPORT);