Re: sock_hold and sock_put

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 24, 2015 at 6:16 PM, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:
> You misunderstood the comment.
>
> Comment only stated that sock_hold() must be used in contexts where
> caller owns a reference (and will eventually release it later with
> sock_put().
>
> There is nothing about having a lock here.

Thanks. I think, i did not put the question right.

I understood the comment perfectly. Suppose i need to use the
sock_hold in some callbacks ( say netdev_notifier chain callback)
function. How can i gurantee race won't happen at the point where i
call sock_hold().
 If i put the question  in another way - say kernel is doing a
sock_put() on a socket, and at the same time  the   netdev_callback
function( that i implemented ) is called on another core ( in smp
machine ). and the  callback is  holding (sock_hold()) on the same
sock.

Thanks,
Ratheesh
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs



[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux