Date: Sat, 17 Nov 2001 10:40:02 -0800 (PST) From: SAKIYAMA Nobuo <sakichan@sakichan.org> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/32059: Linux kernel module (linux.ko) fails to load in -CURRENT Message-ID: <200111171840.fAHIe2985441@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/32059; it has been noted by GNATS.
From: SAKIYAMA Nobuo <sakichan@sakichan.org>
To: freebsd-gnats-submit@FreeBSD.org,
Cc: SAKIYAMA Nobuo <sakichan@sakichan.org>
Subject: Re: kern/32059: Linux kernel module (linux.ko) fails to load in -CURRENT
Date: Sun, 18 Nov 2001 03:37:24 +0900
My patch was incomplete, because that lacks a lock.
Following patch will be correct.
--- sys/compat/linux/linux_socket.c 26 Oct 2001 23:10:08 -0000 1.30
+++ sys/compat/linux/linux_socket.c 17 Nov 2001 18:27:20 -0000
@@ -416,7 +416,7 @@
int namelen;
} */ bsd_args;
struct socket *so;
- struct file *fp;
+ unsigned int flag;
int error;
#ifdef __alpha__
@@ -438,17 +438,20 @@
* when on a non-blocking socket. Instead it returns the
* error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD.
*/
- error = holdsock(td->td_proc->p_fd, linux_args.s, &fp);
- if (error)
+ mtx_lock(&Giant);
+ error = fgetsock(td, linux_args.s, &so, &flag);
+ if (error) {
+ mtx_unlock(&Giant);
return (error);
+ }
error = EISCONN;
- if (fp->f_flag & FNONBLOCK) {
- so = (struct socket *)fp->f_data;
+ if (flag & FNONBLOCK) {
if (so->so_emuldata == 0)
error = so->so_error;
so->so_emuldata = (void *)1;
}
- fdrop(fp, td);
+ fputsock(so);
+ mtx_unlock(&Giant);
return (error);
}
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111171840.fAHIe2985441>
