On Thu, May 21, 2015, at 01:21, Eric Dumazet wrote: > On Wed, 2015-05-20 at 17:35 +0200, Hannes Frederic Sowa wrote: > > This patch implements sendpage support for AF_UNIX SOCK_STREAM > > + > > + if (newskb) > > + skb_queue_tail(&other->sk_receive_queue, newskb); > > Are you sure we need the skb_queue_tail() here (taking spinlock) ? > > This would tell us there might be a possible race. > > A comment would be nice eventually.
Hmm, at first sight, I think we can change this to __skb_queue_tail. sendpage does take state_lock and readlock mutex and thus blocks out both, recvmsg and sendmsg. unix_stream_connect is also serialized by state_lock. I guess I used it because of unix_stream_sendmsg, where it is actually necessary, as recvmsg does unlink skb without state_lock and sendmsg doesn't hold reader mutex. Thanks for the hint! Bye, Hannes -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html