Re: [PATCH -mm1 1/2] fixing idr_find() locking



On Fri, Sep 28, 2007 at 09:08:47AM +0200, Nadia Derbey wrote:
Jarek Poplawski wrote:
On Thu, Sep 27, 2007 at 04:33:55PM +0200, Nadia.Derbey@xxxxxxxx wrote:

[PATCH 01/02]


This is a patch that fixes the way idr_find() used to be called in
ipc_lock():
in all the paths that don't imply an update of the ipcs idr, it was called
without the idr tree being locked.

The changes are:
. in ipc_ids, the mutex has been changed into a reader/writer semaphore.
. ipc_lock() now takes the mutex as a reader during the idr_find().
. a new routine ipc_lock_down() has been defined: it doesn't take the
mutex, assuming that it is being held by the caller. This is the
routine
that is now called in all the update paths.


Signed-off-by: Nadia Derbey <Nadia.Derbey@xxxxxxxx>


Acked-by: Jarek Poplawski <jarkao2@xxxxx>

PS: there is one big mistake around To/Cc ordering, so I doubt Andrew
will ever sign this...



Jarek,

I thought that since you were the one who pointed out the issue I had to
put you as the receiver.
Next time I'll also add Andrew in the To list.
Sorry for that.

It seems Andrew is generous (sometimes) and should forgive you (some
day...). And I'm perfectly happy. Of course, with Cc too. I'm only
a bit confused with this 2/2, which is of course OK, but it seems my
ack isn't needed there.

Thanks,
Jarek P.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH -mm1 1/2] fixing idr_find() locking
    ... in all the paths that don't imply an update of the ipcs idr, ... the mutex has been changed into a reader/writer semaphore. ... a new routine ipc_lock_downhas been defined: ...
    (Linux-Kernel)
  • Re: [PATCH -mm1 1/2] fixing idr_find() locking
    ... in all the paths that don't imply an update of the ipcs idr, ... the mutex has been changed into a reader/writer semaphore. ... a new routine ipc_lock_downhas been defined: ... there is one big mistake around To/Cc ordering, so I doubt Andrew ...
    (Linux-Kernel)
  • Re: C++ Function Static Initialization, Thread-Safe?
    ... void* thread{ ... that says you cannot take a mutex in the `init' routine. ... It's just a problem of waiting for something ...
    (comp.programming.threads)
  • Re: Mutex
    ... I try to use Mutex in my driver program and it does not work as i expect. ... When dma finish his job hi will call interrupt callback function. ... Do you mean Interrupt Service Routine? ...
    (microsoft.public.development.device.drivers)
  • Re: [PATCH 15/15] Add DEFINE_SPUFS_ATTRIBUTE()
    ... DEFINE_SIMPLE_ATTRIBUTE which does the specified locking for the get ... routine for us. ... Have you looked at the change in object code size? ... require the mutex to be held in the first place. ...
    (Linux-Kernel)