All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready()
@ 2022-03-14 22:42 gavin
  2022-03-14 23:00 ` [v2] " bluez.test.bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gavin @ 2022-03-14 22:42 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: linux-bluetooth, Gavin Li

From: Gavin Li <gavin@matician.com>

Callers pass msg->msg_flags as flags, which contains MSG_DONTWAIT
instead of O_NONBLOCK.

Signed-off-by: Gavin Li <gavin@matician.com>
---
 include/net/bluetooth/bluetooth.h | 2 +-
 net/bluetooth/af_bluetooth.c      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index a647e5fabdbd6..59f6e7675554e 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -343,7 +343,7 @@ int  bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg,
 __poll_t bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait);
 int  bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
 int  bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo);
-int  bt_sock_wait_ready(struct sock *sk, unsigned long flags);
+int  bt_sock_wait_ready(struct sock *sk, unsigned int msg_flags);
 
 void bt_accept_enqueue(struct sock *parent, struct sock *sk, bool bh);
 void bt_accept_unlink(struct sock *sk);
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index ee319779781e6..a0cb2e3da8d4c 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -568,7 +568,7 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo)
 EXPORT_SYMBOL(bt_sock_wait_state);
 
 /* This function expects the sk lock to be held when called */
-int bt_sock_wait_ready(struct sock *sk, unsigned long flags)
+int bt_sock_wait_ready(struct sock *sk, unsigned int msg_flags)
 {
 	DECLARE_WAITQUEUE(wait, current);
 	unsigned long timeo;
@@ -576,7 +576,7 @@ int bt_sock_wait_ready(struct sock *sk, unsigned long flags)
 
 	BT_DBG("sk %p", sk);
 
-	timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
+	timeo = sock_sndtimeo(sk, !!(msg_flags & MSG_DONTWAIT));
 
 	add_wait_queue(sk_sleep(sk), &wait);
 	set_current_state(TASK_INTERRUPTIBLE);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [v2] Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready()
  2022-03-14 22:42 [PATCH v2] Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready() gavin
@ 2022-03-14 23:00 ` bluez.test.bot
  2022-03-16 14:29 ` [PATCH v2] " Marcel Holtmann
  2022-03-16 14:30 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2022-03-14 23:00 UTC (permalink / raw)
  To: linux-bluetooth, gavin

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=623339

---Test result---

Test Summary:
CheckPatch                    PASS      1.85 seconds
GitLint                       PASS      1.04 seconds
SubjectPrefix                 PASS      0.92 seconds
BuildKernel                   PASS      31.27 seconds
BuildKernel32                 PASS      27.91 seconds
Incremental Build with patchesPASS      38.17 seconds
TestRunner: Setup             PASS      478.89 seconds
TestRunner: l2cap-tester      PASS      15.81 seconds
TestRunner: bnep-tester       PASS      6.20 seconds
TestRunner: mgmt-tester       PASS      101.58 seconds
TestRunner: rfcomm-tester     PASS      8.03 seconds
TestRunner: sco-tester        PASS      7.81 seconds
TestRunner: smp-tester        PASS      7.77 seconds
TestRunner: userchan-tester   PASS      5.91 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready()
  2022-03-14 22:42 [PATCH v2] Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready() gavin
  2022-03-14 23:00 ` [v2] " bluez.test.bot
@ 2022-03-16 14:29 ` Marcel Holtmann
  2022-03-16 14:30 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2022-03-16 14:29 UTC (permalink / raw)
  To: gavin; +Cc: Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth

Hi Gavin,

> Callers pass msg->msg_flags as flags, which contains MSG_DONTWAIT
> instead of O_NONBLOCK.
> 
> Signed-off-by: Gavin Li <gavin@matician.com>
> ---
> include/net/bluetooth/bluetooth.h | 2 +-
> net/bluetooth/af_bluetooth.c      | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready()
  2022-03-14 22:42 [PATCH v2] Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready() gavin
  2022-03-14 23:00 ` [v2] " bluez.test.bot
  2022-03-16 14:29 ` [PATCH v2] " Marcel Holtmann
@ 2022-03-16 14:30 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2022-03-16 14:30 UTC (permalink / raw)
  To: Gavin Li; +Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Marcel Holtmann <marcel@holtmann.org>:

On Mon, 14 Mar 2022 15:42:52 -0700 you wrote:
> From: Gavin Li <gavin@matician.com>
> 
> Callers pass msg->msg_flags as flags, which contains MSG_DONTWAIT
> instead of O_NONBLOCK.
> 
> Signed-off-by: Gavin Li <gavin@matician.com>
> 
> [...]

Here is the summary with links:
  - [v2] Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready()
    https://git.kernel.org/bluetooth/bluetooth-next/c/f09ab95cfdb4

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-16 14:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-14 22:42 [PATCH v2] Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready() gavin
2022-03-14 23:00 ` [v2] " bluez.test.bot
2022-03-16 14:29 ` [PATCH v2] " Marcel Holtmann
2022-03-16 14:30 ` patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.