On Sun, Feb 25 2001, Alexander Viro wrote: > > > if (atomic_dec_and_test(...)) > > > up(...); > > > not just > > > atomic_dec(...); > > > up(...); > > > > > > Otherwise you can end up with too early exit of loop_thread. Normally > > > it would not matter, but in pathological cases... > > > > How so? We dec it and up the semaphore, loop_thread runs until it's > > done and ups lo_sem. > > You are risking an extra up() here. Think what happens if you already had a > pending request. Ah ok, I see what you mean. Updated patch attached. -- Jens Axboe