Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jun 95 12:12:53 MDT
From:      terry@cs.weber.edu (Terry Lambert)
To:        peter@haywire.DIALix.COM (Peter Wemm)
Cc:        current@freebsd.org
Subject:   Re: bug in Linux^H^H^H^H^HDoom Emulator
Message-ID:  <9506261812.AA28518@cs.weber.edu>
In-Reply-To: <Pine.SV4.3.91.950626224220.12512A-100000@haywire.DIALix.COM> from "Peter Wemm" at Jun 26, 95 10:50:06 pm

next in thread | previous in thread | raw e-mail | index | archive | help
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
DO NOT COMMIT THIS WITHOUT FURTHER CHANGES!
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> *** linux_misc.c.dist	Mon Jun 26 01:32:37 1995
> --- linux_misc.c	Mon Jun 26 22:38:41 1995
> ***************
> *** 188,194 ****
>       printf("Linux-emul(%d): uselib(%s)\n", p->p_pid, path);
>   #endif
>   
> !     NDINIT(&ni, LOOKUP, FOLLOW, UIO_SYSSPACE, path, p);
>       if (error = namei(&ni))
>   	return error;
>   
> --- 188,194 ----
>       printf("Linux-emul(%d): uselib(%s)\n", p->p_pid, path);
>   #endif
>   
> !     NDINIT(&ni, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, path, p);
>       if (error = namei(&ni))
>   	return error;
>   
> ***************
> *** 215,220 ****
> --- 215,222 ----
>   
>       if (error = VOP_OPEN(vnodep, FREAD, p->p_ucred, p))
>   	return error;
> + 
> +     VOP_UNLOCK(vnodep);	/* lock no longer needed */
>   
>       error = vm_mmap(kernel_map, (vm_offset_t *)&a_out, 1024,
>   	    	    VM_PROT_READ, VM_PROT_READ, 0, (caddr_t)vnodep, 0);


At the *absolute* least:

	if (error = VOP_OPEN(vnodep, FREAD, p->p_ucred, p)) {
		VOP_UNLOCK(vnodep);	/* lock no longer needed */
		return error;
	}

	VOP_UNLOCK(vnodep);	/* lock no longer needed */

Unfortunately, from context, I can't tell if there are other intervening
error returns or not.  If so, they need the same change!


					Terry Lambert
					terry@cs.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9506261812.AA28518>