Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 May 2008 10:42:31 -0700
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        Roman Divacky <rdivacky@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, Ulf Lilleengen <lulf@FreeBSD.org>, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/fs/fdescfs fdesc.h fdesc_vfsops.c fdesc_vnops.c
Message-ID:  <20080525174230.GA91789@citylink.fud.org.nz>
In-Reply-To: <20080525172926.GA12033@freebsd.org>
References:  <200805241451.m4OEpU1r053111@repoman.freebsd.org> <20080525172926.GA12033@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, May 25, 2008 at 07:29:26PM +0200, Roman Divacky wrote:
> On Sat, May 24, 2008 at 02:51:30PM +0000, Ulf Lilleengen wrote:
> > lulf        2008-05-24 14:51:30 UTC
> > 
> >   FreeBSD src repository
> > 
> >   Modified files:
> >     sys/fs/fdescfs       fdesc.h fdesc_vfsops.c fdesc_vnops.c 
> >   Log:
> >   - Add locking to all filesystem operations in fdescfs and flag it as MPSAFE.
> >   - Use proper synhronization primitives to protect the internal fdesc node cache
> >     used in fdescfs.
> >   - Properly initialize and uninitalize hash.
> >   - Remove unused functions.
> >   
> >   Since fdescfs might recurse on itself, adding proper locking to it needed some
> >   tricky workarounds in some parts to make it work. For instance, a descriptor in
> >   fdescfs could refer to an open descriptor to itself, thus forcing the thread to
> >   recurse on vnode locks. Because of this, other race conditions also had to be
> >   fixed.
> >   
> >   Tested by:      pho
> >   Reviewed by:    kib (mentor)
> >   Approved by:    kib (mentor)
> 
> +       LIST_FOREACH(fd2, fc, fd_hash) {                                                                           
> +               if (fd == fd2) {                                                                                   
> +                       LIST_REMOVE(fd, fd_hash);                                                                  
> +                       break;                                                                                     
> +               }                                                                                                  
> +       }                   
> 
> shouldn't you use LIST_FOREACH_SAFE here?

No, because the break exits the loop.



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