Re: [patch 4/4] ipc: sem optimise simple operations

Cyrill Gorcunov
2009-08-11T20:07:17Z

[npiggin@suse.de - Tue, Aug 11, 2009 at 09:09:06PM +1000]
...
| +static void update_queue_simple(struct sem_array *sma, ushort semnum)
| +{
| + if (unlikely(sma->complex_count)) {
| + update_queue(sma);
| + } else {
| + struct sem *sem;
| +
| + sem = &sma->sem_base[semnum];
| + if (sem->semval > 0)
| + update_negv_queue(sma, sem);
| + if (sem->semval == 0)
| + update_zero_queue(sma, sem);
| + }
| +}
| +
...

Hi Nick,

mostly probably miss something but can't we trgigger BUG_ON at updating
zero queue if semaphore was created with undo list and via new operation
reached -ERANGE on undo value?

Again, I could be missing something or plain wrong. Just a thought.

-- Cyrill