Cedric Le Goater wrote:here's the refreshed version not taking into account the space in its kernel thread name. C. Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> --- net/bluetooth/bnep/core.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) Index: 2.6.21-rc6-mm1/net/bluetooth/bnep/core.c =================================================================== --- 2.6.21-rc6-mm1.orig/net/bluetooth/bnep/core.c +++ 2.6.21-rc6-mm1/net/bluetooth/bnep/core.c @@ -47,6 +47,7 @@ #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/skbuff.h> +#include <linux/kthread.h> #include <asm/unaligned.h> @@ -473,16 +474,18 @@ static int bnep_session(void *arg) BT_DBG(""); - daemonize("kbnepd %s", dev->name); set_user_nice(current, -15); init_waitqueue_entry(&wait, current); add_wait_queue(sk->sk_sleep, &wait); - while (!atomic_read(&s->killed)) { + while (1) { try_to_freeze(); set_current_state(TASK_INTERRUPTIBLE); + if (atomic_read(&s->killed)) + break; + // RX while ((skb = skb_dequeue(&sk->sk_receive_queue))) { skb_orphan(skb); @@ -539,6 +542,7 @@ static struct device *bnep_get_device(st int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock) { + struct task_struct *task; struct net_device *dev; struct bnep_session *s, *ss; u8 dst[ETH_ALEN], src[ETH_ALEN]; @@ -598,9 +602,10 @@ int bnep_add_connection(struct bnep_conn __bnep_link_session(s); - err = kernel_thread(bnep_session, s, CLONE_KERNEL); - if (err < 0) { - /* Session thread start failed, gotta cleanup. */ + task = kthread_run(bnep_session, s, "kbnepd %s", dev->name); + if (IS_ERR(task)) { + /* Session thread start failed, gotta cleanup. */ + err = PTR_ERR(task); unregister_netdev(dev); __bnep_unlink_session(s); goto failed; -
| Arjan van de Ven | [patch] Add basic sanity checks to the syscall execution patch |
| Matthew Wilcox | Re: AIM7 40% regression with 2.6.26-rc1 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
git: | |
| Andy Whitcroft | Re: VCS comparison table |
| David | User's mailing list? And multiple cherry pick |
| Scott Chacon | Git Community Book |
| Mark Levedahl | Re: [PATCH] Teach remote machinery about remotes.default config variable |
| Marco Peereboom | Re: Real men don't attack straw men |
| Richard Stallman | Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Tony Abernethy | Re: What is our ultimate goal?? |
| Arjan van de Ven | Re: [GIT]: Networking |
| Jeff Garzik | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Denys Fedoryshchenko | packetloss, on e1000e worse than r8169? |
| Radu Rendec | Endianness problem with u32 classifier hash masks |
