[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-557-gd380c49

tridge at samba.org tridge at samba.org
Thu Mar 19 22:56:52 GMT 2009


Hi Metze,

 > >     fixed a logic bug in the tevent nesting code
 > >     
 > >     The event nesting code never triggered as nesting.level was never
 > >     greater than 1. The main event loop needs to increase the nesting
 > >     level by 1.
 > 
 > That was desired, why do you want to be called if there's no nesting?
 > you do if (unixuid_nesting_level == 0) return; anyway.

The code as it was previously would only call the hook if we had two
levels of nesting. ie. it would call it when we had this:

 - main loop
   - call to event_loop_once
     - call to event_loop_once
       - calls hook

It was just a simple off by 1 error, as the check was for > 1, which
meant it only triggered when the nesting was 2 or greater. It started
at zero. 

 > If we change it to call the hook at level 0, we should change that in
 > tevent_loop_once() and not in tevent_loop_wait().

no, because then we'll get the hook code called in top level code that
calls event_loop_once, such as the smbtorture code.

 > >     I also added a paranoia check to the nesting setup call. The API as
 > >     currently written cannot support multiple nesting hooks, so we need to
 > >     abort if multiple hooks are tried.
 > 
 > I think we should have global in vfs_unixid.c which remembers that we
 > already set the hook and not reset it on each tree connect.

The point of that paranoia check was not for the existing vfs code, it
was for future uses of that API. The API is now a public part of
tevent, and may be used by other libraries or modules. The first time
we used a library like that we would have had silent corruption. 

It would be perfectly possible to re-do the implementation of this
function so that it can cope with multiple pieces of code on the same
event context that need a hook (we could have a linked list of
hooks). By having this paranoia check we will know when we need to
re-do the implementation when we first hit this situation.

Cheers, Tridge


More information about the samba-cvs mailing list