This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Sat Apr 20 01:35:21 2024 Delivery-date: Mon, 17 Apr 2006 19:27:44 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751183AbWDQRXg (ORCPT ); Mon, 17 Apr 2006 13:23:36 -0400 Received: from nproxy.gmail.com ([64.233.182.184]:12554 "EHLO nproxy.gmail.com") by vger.kernel.org with ESMTP id S1751180AbWDQRXf (ORCPT ); Mon, 17 Apr 2006 13:23:35 -0400 Received: by nproxy.gmail.com with SMTP id k27so448549nfc for ; Mon, 17 Apr 2006 10:23:34 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:content-type:content-transfer-encoding; b=BGUc1F0v6skqCUr8DgN9GdArNuyR6836hX+DOaFSMXYSVRP3AbMSwaKkN Received: by 10.48.222.17 with SMTP id u17mr369657nfg; Mon, 17 Apr 2006 10:23:34 -0700 (PDT) Received: from ?147.83.30.197? ( [147.83.30.197]) by mx.gmail.com with ESMTP id l32sm845506nfa.2006.04.17.10.23.33; Mon, 17 Apr 2006 10:23:34 -0700 (PDT) Message-Id: <4443CF0C.9030102@gmail.com> Date: Mon, 17 Apr 2006 19:23:24 +0200 From: jordi Vaquero User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en Mime-Version: 1.0 To: linux-kernel@vger.kernel.org Subject: Re: Badness in local_bh_enable at kernel/softirq.c:140 with inet_stream Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org Hello, First of all, thanks for reply me, but I'm so sorry I not understand your advice. I'm trying to do a disk driver that connect with a server using tcp/ip sockets. I don't understand why the context is the problem I have. I'm looking for it deeply and I find thaht local_bh_enable is used in networks, scsi drivers for enable bottom halves. Sorry if this its in FAQs, but I don't find it. Thanks for advance jordi On 4/6/06, *linux-os (Dick Johnson)* > wrote: On Thu, 6 Apr 2006, jordi Vaquero wrote: > Hello > > I'm trying to make a Linux Kernel module. My module has a network > comunication with sockets, I use the functions like this skeleton, > > sd = sock_create(AF_INET,SOCK_STREAM,IPPROTO_TCP,&sock); > if(sd<0){ > printk(KERN_ERR "Error\n"); > }else{ > sout.sin_family = AF_INET; > err = inet_aton("172.16.151.1 ",&sout.sin_addr); //this > function works well, I implemented it. > sout.sin_port = htons(20000); > sd = sock->ops->connect(sock,(struct sockaddr*)&sout, > sizeof(sout),O_RDWR); > if(sd<0){ > printk(KERN_ERR "Error \n"); > sock_release(sock); > }else{ > USE SENDMSG and RECVMSG > ... > ... > ... > sock_release(sock); > } > > My problem is that sometimes, at some point near the connect function, a > warning is launched and dmesg shows this: > [SNIPPED... Crap] This has become a FAQ... If you need to do this INSIDE the kernel, you need to do it from a kernel thread. Otherwise, your socket is indistinguishable from somebody else's open file descriptor. A file descriptor needs a CONTEXT! The kernel doesn't have a CONTEXT! You need a process to have a context, either a kernel thread or a user-mode task. Cheers, Dick Johnson Penguin : Linux version 2.6.15.4 on an i686 machine (5589.42 BogoMips). Warning : 98.36% of all statistics are fiction, book release in April. _  **************************************************************** The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them. Thank you. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/