On Tue, Jun 16, 2009 at 12:34:19AM +0200, Darren Reed wrote: > If we have a list of 3 resources, A, B and C, lets > assume that all 3 are not RCPRIV_SYSTEM resources. > > The first call to pr_getrctl() will return "A". > > Using the modified code, if the RCTL_DELETE on "A" > fails then which becomes RCTL_NEXT and the next call > to pr_getrctl() will return "B". We delete this > successfully and start over because 'which' is set > back to RCTL_FIRST. The basis for me doing this is > I'm assuming that the RCTL_DELETE on "B" could ^^^^^^^^ > cause unexpected things to happen if I do another > pr_getrcl() with RCTL_NEXT - the thing I want to go > "next" from is now gone.
I'll admit that I don't understand the interfaces involved, so either I must study them in order to further my review, or stop here. At the moment I must stop here. I'll simply point out that you're making an assumption that was far from clear to me. Also, I thought we were deleting the control given in the project configuration, not a list of related controls where that list is known by the kernel. But this probably only shows my ignorance of the subject matter. > It might seem silly to retry RCTL_DELETE on "A" > three times but short of creating another "work > list", it's just a hazard of the implementation. As long as there's a way to break from the loop. > If it helps, I'll expand on the comments for that > loop so that it's clear about what's going on. More comments would be nice, at least with pointers to where to look for docs. Nico --