Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

af_unix: remove redundant lockdep class

After commit 581319c58600 ("net/socket: use per af lockdep classes for sk queues")
sock queue locks now have per-af lockdep classes, including unix socket.
It is no longer necessary to workaround it.

I noticed this while looking at a syzbot deadlock report, this patch
itself doesn't fix it (this is why I don't add Reported-by).

Fixes: 581319c58600 ("net/socket: use per af lockdep classes for sk queues")
Cc: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Cong Wang and committed by
David S. Miller
3848ec5d 51508179

-10
-10
net/unix/af_unix.c
··· 745 745 .obj_size = sizeof(struct unix_sock), 746 746 }; 747 747 748 - /* 749 - * AF_UNIX sockets do not interact with hardware, hence they 750 - * dont trigger interrupts - so it's safe for them to have 751 - * bh-unsafe locking for their sk_receive_queue.lock. Split off 752 - * this special lock-class by reinitializing the spinlock key: 753 - */ 754 - static struct lock_class_key af_unix_sk_receive_queue_lock_key; 755 - 756 748 static struct sock *unix_create1(struct net *net, struct socket *sock, int kern) 757 749 { 758 750 struct sock *sk = NULL; ··· 759 767 goto out; 760 768 761 769 sock_init_data(sock, sk); 762 - lockdep_set_class(&sk->sk_receive_queue.lock, 763 - &af_unix_sk_receive_queue_lock_key); 764 770 765 771 sk->sk_allocation = GFP_KERNEL_ACCOUNT; 766 772 sk->sk_write_space = unix_write_space;