Subject: Re: CVS commit: syssrc/sys/compat/linux/common
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: current-users
Date: 03/23/2002 15:54:28
Yes, it's right. I'd like to change the code a bit, please
let me fix that.

Jaromir

Izumi Tsutsui wrote:
> In article <20020322145328.3F43DB004@cvs.netbsd.org>
> christos@netbsd.org wrote:
> 
> > Module Name:	syssrc
> > Committed By:	christos
> > Date:		Fri Mar 22 14:53:27 UTC 2002
> > 
> > Modified Files:
> > 	syssrc/sys/compat/linux/common: linux_file.c
> > 
> > Log Message:
> > - obey FILE_USE and FILE_UNUSE
> > - don't assume that non sockets point to vnodes.
> 
> Now navigator-4.79 on my i386 got "panic: f_usecount underflow"
> by FILE_UNUSE() in linux_file.c:linux_sys_fcntl().
> Is the following patch right?
> 
> Index: linux_file.c
> ===================================================================
> RCS file: /cvsroot/syssrc/sys/compat/linux/common/linux_file.c,v
> retrieving revision 1.47
> diff -u -r1.47 linux_file.c
> --- linux_file.c	2002/03/22 14:53:26	1.47
> +++ linux_file.c	2002/03/23 10:39:04
> @@ -426,6 +426,7 @@
>  		switch (fp->f_type) {
>  		case DTYPE_SOCKET:
>  			cmd = cmd == LINUX_F_SETOWN ? F_SETOWN : F_GETOWN;
> +			FILE_UNUSE(fp, p);
>  			goto doit;
>  
>  		case DTYPE_VNODE:
> @@ -483,7 +484,6 @@
>  	}
>  
>  doit:
> -	FILE_UNUSE(fp, p);
>  	SCARG(&fca, fd) = fd;
>  	SCARG(&fca, cmd) = cmd;
>  	SCARG(&fca, arg) = arg;
> 
> ---
> Izumi Tsutsui
> tsutsui@ceres.dti.ne.jp
> 


-- 
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/Ports/i386/ps2.html
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-