Panic with this morning's (~9am EDT, 15 jan 2004) sources.

John Baldwin jhb at FreeBSD.org
Fri Jan 16 12:23:06 PST 2004


On Friday 16 January 2004 03:09 pm, Dag-Erling Smørgrav wrote:
> John Baldwin <jhb at FreeBSD.org> writes:
> >          You probably don't need to lock the new filedesc structure
> > while you are creating it until you've actually hooked it up to a
> > proc structure.
>
> Yes, I do.  fdgrowtable() for instance asserts that the filedesc is
> locked.

Then do this:

	while (newfdp blah fdp) {
		FILEDESC_UNLOCK(fdp);
		FILEDESC_LOCK(newfdp);
		fd_growtable(newfdp);
		FILEDESC_UNLOCK(newfdp);
		FILEDESC_LOCK(fdp);
	}

Since no other CPU or thread can possibly go near newfdp until it is hooked 
into a process, you don't need to worry about locking it other than to 
satisfy assertions while you are constructing it.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



More information about the freebsd-current mailing list