Messages in this thread | | | Date | Tue, 20 Apr 2010 14:24:05 -0700 (PDT) | Subject | Re: A possible bug in reqsk_queue_hash_req() | From | David Miller <> |
| |
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Tue, 20 Apr 2010 13:06:51 +0200
> I believe its not really necessary, because we are the only possible > writer at this stage. > > The write_lock() ... write_unlock() is there only to enforce a > synchronisation with readers. > > All callers of this reqsk_queue_hash_req() must have the socket locked
Right.
In fact there are quite a few snippets around the networking where we use this trick of only locking around the single pointer assignment that puts the object into the list.
And they were all written by Alexey Kuznetsov, so they must be correct :-)
| |