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

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 16 Jan 2004 15:23:32 -0500
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
Received on Fri Jan 16 2004 - 11:23:06 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:38 UTC