Re: [squid-users] Question on storeAufsClose

From: Brian <hiryuu@dont-contact.us>
Date: Sun, 2 Sep 2001 16:57:26 -0400

On Sunday 02 September 2001 04:41 am, Robert Collins wrote:
> > So my question is...
> > Can these two run close enough together that storeAufsSomethingPending
> > returns true, but storeAufsClose doesn't set the flag in time to catch
> > storeAufsReadDone?
>
> For a race, we would need the squid main thread to context switch after
> storeAufsSomethingPending(sio), but before setting the flag, and before
> squid had another timeslice, for a different thread to call into
> storeAufsReadDone.
>
> As the same thread calls both functions, that cannot happen.
>
> Why do you ask?

I'm trying to hunt down a FD leak in aufs, so I'm looking for potential
holes where they can slip through.

I thought that this section was single-threaded, but
aiostate->flags.inreaddone is only altered in storeAufsReadDone and only
checked in storeAufsSomethingPending (which is only called by
storeAufsClose). Since inreaddone apparently only exists as a mutex, I
assume one of those functions was going to be threaded.

        -- Brian
Received on Sun Sep 02 2001 - 14:57:29 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:02:01 MST