> > This only works if the entries are inserted in order -- if not, you can > > do something like: > > If I understand your concern correctly then the entries should always be > inserted in order. Mount namespaces are sequentially allocated > serialized on the namespace semaphore "namespace_sem. So each mount > namespace receives a unique 64bit sequence number. If ten mount > namespaces are created with 1, 2, 3, ..., 10 then they are inserted into > the rbtree in that order. And so they should be added to that list in > the same order. That's why I kept it that simple. Nope, you were right, I was wrong. We allocate the sequence number before we hold the namespace semaphore. I misremembered that code. I'll fix this up as you suggested. Thanks!