Date: Wed, 9 Apr 1997 14:27:17 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: dg@root.com Cc: terry@lambert.org, ponds!rivers@dg-rtp.dg.com, hackers@freebsd.org Subject: Re: Some insight on "dup alloc" problems..... Message-ID: <199704092127.OAA07549@phaeton.artisoft.com> In-Reply-To: <199704092135.OAA22510@root.com> from "David Greenman" at Apr 9, 97 02:35:09 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> ... > >| vp = (struct vnode *) malloc((u_long) sizeof *vp, > >| M_VNODE, M_WAITOK); > > ************************************************* > > There are mutex locks in the callers of getnewvnode (specifically UFS) > which force the calls to it to be single-threaded, preventing the vnode > allocation race condition you are refering to. I know because I added them > over a year ago: > > revision 1.24 > date: 1995/07/21 03:52:40; author: davidg; state: Exp; lines: +34 -4 > Implement a lock in ffs_vget to prevent a race condition where two processes > try allocate the same inode/vnode, causing a duplicate. Hmm... If so, the locks wouldn't help -- but they wouldn't hurt, either. The real idea was to prevent allocate and delete operations from being interleaved, not to really fix the problem: just work around it. Terry Lambert terry@lambert.org --- 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?199704092127.OAA07549>