lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080131130930.GW15220@kernel.dk>
Date:	Thu, 31 Jan 2008 14:09:30 +0100
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Dave Young <hidave.darkstar@...il.com>
Cc:	marcel@...tmann.org, davem@...emloft.net,
	linux-kernel@...r.kernel.org, bluez-devel@...ts.sf.net,
	netdev@...r.kernel.org
Subject: Re: [PATCH retry] bluetooth : add conn add/del workqueues to avoid  connection fail

On Wed, Jan 30 2008, Dave Young wrote:
> 
> The bluetooth hci_conn sysfs add/del executed in the default workqueue.
> If the del_conn is executed after the new add_conn with same target,
> add_conn will failed with warning of "same kobject name".
> 
> Here add btaddconn & btdelconn workqueues,
> flush the btdelconn workqueue in the add_conn function to avoid the issue.
> 
> Signed-off-by: Dave Young <hidave.darkstar@...il.com> 
> 
> ---
> diff -upr a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
> --- a/net/bluetooth/hci_sysfs.c	2008-01-30 10:14:27.000000000 +0800
> +++ b/net/bluetooth/hci_sysfs.c	2008-01-30 10:14:14.000000000 +0800
> @@ -12,6 +12,8 @@
>  #undef  BT_DBG
>  #define BT_DBG(D...)
>  #endif
> +static struct workqueue_struct *btaddconn;
> +static struct workqueue_struct *btdelconn;
>  
>  static inline char *typetostr(int type)
>  {
> @@ -279,6 +281,7 @@ static void add_conn(struct work_struct 
>  	struct hci_conn *conn = container_of(work, struct hci_conn, work);
>  	int i;
>  
> +	flush_workqueue(btdelconn);
>  	if (device_add(&conn->dev) < 0) {
>  		BT_ERR("Failed to register connection device");
>  		return;
> @@ -313,6 +316,7 @@ void hci_conn_add_sysfs(struct hci_conn 
>  
>  	INIT_WORK(&conn->work, add_conn);
>  
> +	queue_work(btaddconn, &conn->work);
>  	schedule_work(&conn->work);
>  }

So you queue &conn->work on both btaddconn and keventd_wq?

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ