lkml.org 
[lkml]   [2014]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/6] ipc/sem.c: Bugfix for semctl(,,GETZCNT)
Hi Davidlohr,

On 05/12/2014 08:11 PM, Davidlohr Bueso wrote:
> On Sat, 2014-05-10 at 12:03 +0200, Manfred Spraul wrote:
>> GETZCNT is supposed to return the number of threads that wait until
>> a semaphore value becomes 0.
>> The current implementation overlooks complex operations that contain
>> both wait-for-zero operation and operations that alter at least one semaphore.
> Indeed. the pending_alter list does represent blocked processes on the
> sem. Good catch. Btw, how on earth did you run into this? reading the
> code or a real case?
Reading the code.
Or more accurately:
Rewriting it, i.e. I first starting coding the new semncnt/semzcnt code,
then I noticed that the current code is buggy.

>> The patch fixes that.
>> It's intentionally copy&paste, this will be cleaned up in the next patch.
> Instead I would have expected this patch to actually come after the
> count_* refactoring.
>
In this case:
First the bugfix, as simple as possible, then the new features.

--
Manfred


\
 
 \ /
  Last update: 2014-05-13 20:21    [W:0.181 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site