Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp687103lqb; Fri, 15 Mar 2024 03:49:48 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCX78x5OF1uDjgmhbLSEuDdUtQsWRjGg4esXUnj4UqXCGT4MIX4EsXH8NDo8H1Y795Xjfpv8KbZWVmlJmXaH66WyoExdkv7fC/wUNTnoRg== X-Google-Smtp-Source: AGHT+IHc9onzIHG/GiRikTAkrL4LX43sUoOvvPoiA8DOiwHszQ4dNkXiCHEAYVfg4tC+HkF2qO+T X-Received: by 2002:a17:903:234b:b0:1de:fab2:98eb with SMTP id c11-20020a170903234b00b001defab298ebmr291108plh.5.1710499788342; Fri, 15 Mar 2024 03:49:48 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1710499788; cv=pass; d=google.com; s=arc-20160816; b=AYllJ89/QHCYyCMJrreaIZ1x6Wz6WPbEz6OCGJjLy/0dlKl2i1FaSOteSxr7gIUKyw Ih5Ck2Qs1b+D0aSHMv1mq5Abr1zsuI0i036mLK2bktgDhNoofszZXRPlFvoXsLcRhPQo AUJ/5DL1egXCSZ4kommuD+M7NQTatwFjTPy7/6zR8V/d7sAZVNVkCpCva6NLm4L1HNG5 zYr+mEYKFwoOQ38/lmX5UTSssRB+OkILo+4ruQBGI8bGqrTcIfjgoz6GFVt2McZ4SnPk hi95LICwPz7SH8ZpqrKGJenhM/od7qRlr4fYzHaud92Rilm4T+2yaYtBWes45N0H95kD 0Z/w== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=ZJCwxTddZ33N6Bgz0+H7sdAc88CchSTXvlPnGIfDdnE=; fh=v4Z3N2Htbr8NtGqMLkQjkIE/EbeUcf6lhEWEAm07n3g=; b=dSKaEzt4uAF/vhCFiI6PiinR9sg5G4fEXFSM2zfbaXCB7uKFVtKeQ9TH105oQsVM7I bi+bVxbwpthibowH2ZP8paHZczQr3XE0SvUaIqWQpf/7Wg+nmEZTRrcwIJ0j/xVn0kC6 kqPj1YK1oFRfSba62L0Za/X8y1hpUPSMI1/vKfMk+c8Ae6db8oUEyEro9sqNrB1P92nW ZIk0b5wepOyfm639anSpw+hvyCWQh+fnF4Xjbv320AtyBf3WthwNDBKL6t1HLs77n+1F pq12mrNuX9ORoREKKSldy6Tu0OR5udhZ2IpPlpKY0qmfEoadegQbqUIDiUrQeLU8MSnx Dr2Q==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@iki.fi header.s=lahtoruutu header.b=mE3bxTi6; arc=pass (i=2 spf=pass spfdomain=iki.fi dkim=pass dkdomain=iki.fi); spf=pass (google.com: domain of linux-bluetooth+bounces-2547-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2547-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y14-20020a17090322ce00b001dcfadc1cffsi3373536plg.392.2024.03.15.03.49.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 03:49:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2547-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@iki.fi header.s=lahtoruutu header.b=mE3bxTi6; arc=pass (i=2 spf=pass spfdomain=iki.fi dkim=pass dkdomain=iki.fi); spf=pass (google.com: domain of linux-bluetooth+bounces-2547-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2547-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D46C9283A26 for ; Fri, 15 Mar 2024 10:49:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C341A18EAF; Fri, 15 Mar 2024 10:49:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b="mE3bxTi6" X-Original-To: linux-bluetooth@vger.kernel.org Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD68E17584 for ; Fri, 15 Mar 2024 10:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.185.170.37 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710499784; cv=pass; b=PqUSxtHNIe+F7Njfkgzhj87yA2cpgUPJvGAB1exnrvA6jIEtKJ4GMstbglF9afSTglTB755eIRkxjNalmj9MpPbhJXNB0I6sQFOxwwCjGylbnM5XOqSkz87jaiU54eFxHhyV1f/pthXidwOdFO3SuBrFLGMxcI+WkH14NttBb/I= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710499784; c=relaxed/simple; bh=KxRKO+SGYNKSKtyZFTobBUcoKKtMO9YN4WEumOOkx8M=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=ZUw9NapRf9MqLBNFzmEeGXqxIXvLFlOgPBct1ODfrRfIxwWcOcmYrC0iLPi+0TQNRRT7exdw/5nGCJYv+21l+WxT2Cf0GO4E7d/Sp3sy5UPMOQhHn5oW4woATXI+oGEhyDyorr3dJfimgPt4+VoeZjncbXvn7/uivJXiAInGtis= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b=mE3bxTi6; arc=pass smtp.client-ip=185.185.170.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Received: from [192.168.1.195] (unknown [IPv6:2a0c:f040:0:2790::a01d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav@iki.fi) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4Tx1GR36F2z49Psp; Fri, 15 Mar 2024 12:49:35 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1710499776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=ZJCwxTddZ33N6Bgz0+H7sdAc88CchSTXvlPnGIfDdnE=; b=mE3bxTi6XwZC/ROfkvuL/f3cw9RGaH1CjEN1yNPbnEPOX2nWJo8Zrt/YPdVWSYuf6usKdS l0KHd2b3mNltcJ9/gFfA+3Hpn9R6UTk8VxZr1KvG/XBXMy3xWoyc6Eh/12otOsPXZqpKkU IIa2QGZPR3q+48XjWZC+2OCBebEraHINSQSY+uNBLCVnr5wnoBCxsSYWR/cUhjJh/aaRXq 8azYhTviiDJd5OI6Pbc2cRZbw8GOvFVg6EdYtBVT9Ty+SPTgynnevtB5HaYyT+m98O8uuB jq5jvWEmmcXv47pm4w6HXOtYswMLP4iMFcAOkr5m9Y9amF4Wv6W1sbxRGNFF1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1710499776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=ZJCwxTddZ33N6Bgz0+H7sdAc88CchSTXvlPnGIfDdnE=; b=NncMGI5BvbJgTORdTI0frHfgeF5hDvYwL6VrUgsutGY5oWISw2hLv0obmdPEvi5xd26QMN osj1IFrKG642FfqwF+HU+wm7HLwHrcZi3yGKkZOneOmJ/uDWk2PpbluKqbvU/t1CBF4Ifq 1OK1TuuQziU7uxtlb8Gtpg0vYhEqrE7L+6PWvwbYQXRSS0Aj12iKefmWvUQiZto6KWMMzp vFqejvmXgs43QrL4dhuaSrFFrGHvWhU2/jtQMrrG7oc5INxIAP86ChUJsr1BXJroqz6Hrj SsoNoZZGa1vJIdAw1ofWEMzDYW/okUmRjnxE4X7BbyYXocqodw5s/5v+dBHU0w== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav@iki.fi smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1710499776; a=rsa-sha256; cv=none; b=Ob0IDyoMqHbE6P2RCid0UT+glQNjk3BWWoi7/wLxzkoYwS9CSz1JN5ofpJQm2F1gEg2ZcA spcMp+wbV4r6OK4oEkrZWnTU/V12EAr/8ettYsFawqiN/4WH8ZbrAtplgLyBLbclyncJtX 9ngIoR1bF2d+6jTfAEbqVxmfllVQt4XRNCs7wydaIE7q6tQiOmJI7AELxJoU32ssbZ9LtY q2rPbtnzEDuTZ6Ee4gL4AjPhFF/3Wn33VTDFz9PaqgQOgHXDTCn6BdzoF0YkcZKFMiBpdA 1ZWDMUsuS66netvlijXhhclFTSDPcObN8KQSmPU4tWpj7QKgRnORfYJFdoYUlg== Message-ID: <985fa44991c27e773f2a4b4fafaf5879719eb6fb.camel@iki.fi> Subject: Re: [PATCH v2 5/5] Bluetooth: add BT_NO_ERRQUEUE_POLL socket option From: Pauli Virtanen To: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org Date: Fri, 15 Mar 2024 12:49:31 +0200 In-Reply-To: References: <134027f3cbaeb7095d080c27cd4b1053d2eb560e.1710440392.git.pav@iki.fi> Autocrypt: addr=pav@iki.fi; prefer-encrypt=mutual; keydata=mQGiBDuWdUoRBAD5TV1PNJbFxQRmG3moFyJT74l8/6ailvCjgIzwl6Umi4oaDsrogD+myums6lgYe+J2kmbe1Sk2MiOdWzRgY+HbrW5tr8UV+hmNg88gMz9gl2ygWHgG/CSa53Zn+R6TmXXL23KafCYOWH2NKaXxU31c/0Da+yEI+AgkrW8nCOMeFwCgzuJK2qqKtjLqh7Iukt1Urxdp1IUEAMFVHx9TPoFEk4OsuWJRunn7cylFsI/FQlXqXa4GHwhA5zKTMJHo6aX8ITQlnZfdZuxBWF2bmdK2/CRzp0dirJw+f4Qa163kaH2gTq5b+xZXF56xgYMO3wgANtDG1ZKBmYpnV7lFPYpbuNuR0JpksBL5G1Ml3WGblpb4EWtVNrWfA/91HylTGtZnNIxI8iJUjDN0uPHgPVM90C/bU2Ll3i3UpyuXwSFIJq00+bxGQh/wWa50G6GvrBStzhAXdQ1xQRusQBppFByjCpVpzkCyV6POe74pa4m88PRhXKlj2MKWbWjxZeU88sAWhFx5u79Cs6imTSckOCyg0eiO4ca1TLZOGbQbUGF1bGkgVmlydGFuZW4gPHBhdkBpa2kuZmk+iIEEExEKAEECGyMCHgECF4ACGQEFCwkIBwMFFQoJCAsFFgIDAQAWIQSfjAgX4lc0PoQd+D3oFDFvs7SlYAUCWZ8gRwUJHgn8fQAKCRDoFDFvs7SlYELXAJ47uNwB5yXTPDmAhIebcrlE0Ub0kgCdGAfxvoNmbwJwk1sAikf9H5FBBBC0I1BhdWxpI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BRUKCQgLBRYCAwEAAh4BAheAFiEEiNDtwDFNJaodBiJZHOiglY3YpVcFAllP1OgFCQ1MBMwACgkQHOiglY3YpVfiOA//YLTyfBMolR5K/s2WV/mgwQEJZqhdwBT+L/0mxqhuFMWuDnvkUzzBxLTM5a66SB4/JZtyQt14VSnRCuxBUaw/IUftK0ru3zIZjWFfLgHwSUwJCSy6oYwm7x2MAiKQUtAzpSfFJnwyQG2wK1uy6EpSjBX7YphlpKKv6UGiL0QuwWtXALrbI4EVbnozes89CaZHeE6zx/aDQgKa4ajInkIIvtOBmRqbvTPkJjcH84o7b84rP10DSO2Q2ooP8WYQ85y9RkF00yndR01VwNnURt7XmjVuoy8el0WUMv0q7evGTWSmXDPtUMq8e5DKt1uHWdkjV3uhHXjUTlI2gdMrxzbzxPYIWVWg4eE9jEdQvvGaYhDfFpmqF/ZSQT9jUCuWXMMpscy8NrmHnJtTvHBEfmaSgOQPnI7D7AA62q6mAVWEjcfKpgEs0Z2SK75P5yHmD2yEdZy+wSD8zheY1YDqvL50rx+l3mqoONmBwiW7R5dkMInqgQ156Uf8yMc8vv5exARr8WhJV61R2mSeHfxTFMMXaFG//NTHNX7ZpP0tECyePbu+IB32oa7P45EoNRZnLDG2KDOFsoUuy+CzQYPku5Gz8aqcgP7k8wb4J3QPPfiaAYrRJ9XOoiLUDodnWnPW9zLA1yWMnarzilEFPVmBztx6JKxlbFxnOfO6u5ry+uXZC4w= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi Luiz, to, 2024-03-14 kello 23:18 -0400, Luiz Augusto von Dentz kirjoitti: > Hi Pauli, >=20 > On Thu, Mar 14, 2024 at 2:23=E2=80=AFPM Pauli Virtanen wrote= : > >=20 > > Add socket option to disable POLLERR on non-empty socket error queue. > >=20 > > Applications can use this for sleeping socket error POLLERR waits, also > > when using TX timestamping. This is useful when multiple layers of the > > stack are using the same socket. >=20 > So the idea here is that bluetoothd would set BT_NO_ERRQUEUE_POLL to > not be awakened by timestamps? I wonder why this works on per > fd/socket level while SO_TIMESTAMPING does apply to all sockets > though, or perhaps that is not really related to SO_TIMESTAMPING but > errqueue being the same to all cloned sockets? I'm a little hesitant > to start introducing new socket options if the whole point was to > avoid doing so with the use of SO_TIMESTAMPING. It works the same as SO_TIMESTAMPING, setting BT_NO_ERRQUEUE_POLL applies to all fds referring to the socket, so it is not per fd either. The idea is that Pipewire sets BT_NO_ERRQUEUE_POLL before enabling SO_TIMESTAMPING. Then nobody gets POLLERR on errqueue messages. Instead, it reads MSG_ERRQUEUE always when sending the next packet, instead of using POLLERR. This works fine in practice and is tested. I'd appreciate if we can agree on the whole-stack plan. *** For sockets vs. fds, see net/socket.c:sockfd_lookup dup() of fd creates new int fd pointing to the same struct file & struct socket, but not duplicate struct socket/sock, see fs/file.c:1412 Passing fds via unix socket like in DBus seems the same, see include/net/scm.h:scm_recv_one_fd & fs/file.c:receive_fd Indeed, you can also see this in debug logs, e.g.=C2=A0 [53573.676885] iso_sock_getname:1103: sock 0000000018c143a2, sk 000000002af= f8d2b (from BlueZ) [53580.831753] iso_sock_getname:1103: sock 00000000419df212, sk 00000000526= df659 (from BlueZ) ... [53592.472038] iso_sock_sendmsg:1127: sock 0000000018c143a2, sk 000000002af= f8d2b (from PW) [53592.472062] iso_sock_sendmsg:1127: sock 00000000419df212, sk 00000000526= df659 (from PW) setsockopt(), errqueue, RX queue etc. are struct socket level stuff. >=20 >=20 > > Signed-off-by: Pauli Virtanen > > --- > > include/net/bluetooth/bluetooth.h | 9 +++- > > net/bluetooth/af_bluetooth.c | 72 ++++++++++++++++++++++++++++++- > > net/bluetooth/iso.c | 8 ++-- > > net/bluetooth/l2cap_sock.c | 8 ++-- > > net/bluetooth/sco.c | 8 ++-- > > 5 files changed, 91 insertions(+), 14 deletions(-) > >=20 > > diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/= bluetooth.h > > index 9280e72093ee..dcee5384d715 100644 > > --- a/include/net/bluetooth/bluetooth.h > > +++ b/include/net/bluetooth/bluetooth.h > > @@ -240,6 +240,8 @@ struct bt_codecs { > >=20 > > #define BT_ISO_BASE 20 > >=20 > > +#define BT_NO_ERRQUEUE_POLL 21 > > + > > __printf(1, 2) > > void bt_info(const char *fmt, ...); > > __printf(1, 2) > > @@ -387,7 +389,8 @@ struct bt_sock { > > enum { > > BT_SK_DEFER_SETUP, > > BT_SK_SUSPEND, > > - BT_SK_PKT_STATUS > > + BT_SK_PKT_STATUS, > > + BT_SK_NO_ERRQUEUE_POLL > > }; > >=20 > > struct bt_sock_list { > > @@ -410,6 +413,10 @@ int bt_sock_stream_recvmsg(struct socket *sock, s= truct msghdr *msg, > > size_t len, int flags); > > __poll_t bt_sock_poll(struct file *file, struct socket *sock, poll_tab= le *wait); > > int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned lon= g arg); > > +int bt_sock_setsockopt(struct socket *sock, int level, int optname, > > + sockptr_t optval, unsigned int optlen); > > +int bt_sock_getsockopt(struct socket *sock, int level, int optname, > > + char __user *optval, int __user *optlen); > > int bt_sock_wait_state(struct sock *sk, int state, unsigned long time= o); > > int bt_sock_wait_ready(struct sock *sk, unsigned int msg_flags); > >=20 > > diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.= c > > index 67604ccec2f4..997197aa7b48 100644 > > --- a/net/bluetooth/af_bluetooth.c > > +++ b/net/bluetooth/af_bluetooth.c > > @@ -500,6 +500,12 @@ static inline __poll_t bt_accept_poll(struct sock = *parent) > > return 0; > > } > >=20 > > +static bool bt_sock_error_queue_poll(struct sock *sk) > > +{ > > + return !test_bit(BT_SK_NO_ERRQUEUE_POLL, &bt_sk(sk)->flags) && > > + !skb_queue_empty_lockless(&sk->sk_error_queue); > > +} > > + > > __poll_t bt_sock_poll(struct file *file, struct socket *sock, > > poll_table *wait) > > { > > @@ -511,7 +517,7 @@ __poll_t bt_sock_poll(struct file *file, struct soc= ket *sock, > > if (sk->sk_state =3D=3D BT_LISTEN) > > return bt_accept_poll(sk); > >=20 > > - if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue= )) > > + if (sk->sk_err || bt_sock_error_queue_poll(sk)) > > mask |=3D EPOLLERR | > > (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? EPOLLPR= I : 0); > >=20 > > @@ -582,6 +588,70 @@ int bt_sock_ioctl(struct socket *sock, unsigned in= t cmd, unsigned long arg) > > } > > EXPORT_SYMBOL(bt_sock_ioctl); > >=20 > > +int bt_sock_setsockopt(struct socket *sock, int level, int optname, > > + sockptr_t optval, unsigned int optlen) > > +{ > > + struct sock *sk =3D sock->sk; > > + int err =3D 0; > > + u32 opt; > > + > > + if (level !=3D SOL_BLUETOOTH) > > + return -ENOPROTOOPT; > > + > > + lock_sock(sk); > > + > > + switch (optname) { > > + case BT_NO_ERRQUEUE_POLL: > > + if (copy_from_sockptr(&opt, optval, sizeof(opt))) { > > + err =3D -EFAULT; > > + break; > > + } > > + > > + if (opt) > > + set_bit(BT_SK_NO_ERRQUEUE_POLL, &bt_sk(sk)->fla= gs); > > + else > > + clear_bit(BT_SK_NO_ERRQUEUE_POLL, &bt_sk(sk)->f= lags); > > + break; > > + > > + default: > > + err =3D -ENOPROTOOPT; > > + break; > > + } > > + > > + release_sock(sk); > > + return err; > > +} > > +EXPORT_SYMBOL(bt_sock_setsockopt); > > + > > +int bt_sock_getsockopt(struct socket *sock, int level, int optname, > > + char __user *optval, int __user *optlen) > > +{ > > + struct sock *sk =3D sock->sk; > > + int err =3D 0; > > + u32 opt; > > + > > + if (level !=3D SOL_BLUETOOTH) > > + return -ENOPROTOOPT; > > + > > + lock_sock(sk); > > + > > + switch (optname) { > > + case BT_NO_ERRQUEUE_POLL: > > + opt =3D test_bit(BT_SK_NO_ERRQUEUE_POLL, &bt_sk(sk)->fl= ags); > > + if (put_user(opt, (u32 __user *)optval)) > > + err =3D -EFAULT; > > + break; > > + > > + default: > > + err =3D -ENOPROTOOPT; > > + break; > > + } > > + > > + release_sock(sk); > > + return err; > > +} > > +EXPORT_SYMBOL(bt_sock_getsockopt); > > + > > /* This function expects the sk lock to be held when called */ > > int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo= ) > > { > > diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c > > index a77ab9df7994..6f5af549a8cc 100644 > > --- a/net/bluetooth/iso.c > > +++ b/net/bluetooth/iso.c > > @@ -1596,8 +1596,8 @@ static int iso_sock_setsockopt(struct socket *soc= k, int level, int optname, > > break; > >=20 > > default: > > - err =3D -ENOPROTOOPT; > > - break; > > + release_sock(sk); > > + return bt_sock_setsockopt(sock, level, optname, optval,= optlen); > > } > >=20 > > release_sock(sk); > > @@ -1667,8 +1667,8 @@ static int iso_sock_getsockopt(struct socket *soc= k, int level, int optname, > > break; > >=20 > > default: > > - err =3D -ENOPROTOOPT; > > - break; > > + release_sock(sk); > > + return bt_sock_getsockopt(sock, level, optname, optval,= optlen); > > } > >=20 > > release_sock(sk); > > diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c > > index 9a9f933a748b..06277ce1fd6b 100644 > > --- a/net/bluetooth/l2cap_sock.c > > +++ b/net/bluetooth/l2cap_sock.c > > @@ -697,8 +697,8 @@ static int l2cap_sock_getsockopt(struct socket *soc= k, int level, int optname, > > break; > >=20 > > default: > > - err =3D -ENOPROTOOPT; > > - break; > > + release_sock(sk); > > + return bt_sock_getsockopt(sock, level, optname, optval,= optlen); > > } > >=20 > > release_sock(sk); > > @@ -1102,8 +1102,8 @@ static int l2cap_sock_setsockopt(struct socket *s= ock, int level, int optname, > > break; > >=20 > > default: > > - err =3D -ENOPROTOOPT; > > - break; > > + release_sock(sk); > > + return bt_sock_setsockopt(sock, level, optname, optval,= optlen); > > } > >=20 > > release_sock(sk); > > diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c > > index b3c2af7c7d67..b8b1b314aed4 100644 > > --- a/net/bluetooth/sco.c > > +++ b/net/bluetooth/sco.c > > @@ -968,8 +968,8 @@ static int sco_sock_setsockopt(struct socket *sock,= int level, int optname, > > break; > >=20 > > default: > > - err =3D -ENOPROTOOPT; > > - break; > > + release_sock(sk); > > + return bt_sock_setsockopt(sock, level, optname, optval,= optlen); > > } > >=20 > > release_sock(sk); > > @@ -1211,8 +1211,8 @@ static int sco_sock_getsockopt(struct socket *soc= k, int level, int optname, > > break; > >=20 > > default: > > - err =3D -ENOPROTOOPT; > > - break; > > + release_sock(sk); > > + return bt_sock_getsockopt(sock, level, optname, optval,= optlen); > > } > >=20 > > release_sock(sk); > > -- > > 2.44.0 > >=20 > >=20 >=20 >=20