public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: jordi Vaquero <jordi.vaquero@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: Badness in local_bh_enable at kernel/softirq.c:140 with inet_stream
Date: Mon, 17 Apr 2006 19:23:24 +0200	[thread overview]
Message-ID: <4443CF0C.9030102@gmail.com> (raw)


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)* <linux-os@analogic.com
<mailto:linux-os@analogic.com>> 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
    <http://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 <http://2.6.15.4> on an i686
    machine (5589.42 BogoMips).
    Warning : 98.36% of all statistics are fiction, book release in April.
    _
    \x1a\x04

    ****************************************************************
    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 <mailto:DeliveryErrors@analogic.com> -
    and destroy all copies of this information, including any
    attachments, without reading or disclosing them.

    Thank you.




             reply	other threads:[~2006-04-17 17:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-17 17:23 jordi Vaquero [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-04-06 17:18 Badness in local_bh_enable at kernel/softirq.c:140 with inet_stream jordi Vaquero
2006-04-06 17:59 ` linux-os (Dick Johnson)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4443CF0C.9030102@gmail.com \
    --to=jordi.vaquero@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox