The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Etay Meiri <cl1@netvision.net.il>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: keeping the socket open in the kernel
Date: Mon, 05 Nov 2001 23:45:05 +0200	[thread overview]
Message-ID: <20011105234505.B17086@amber> (raw)

Hi,

Consider the following scenario:
A daemon is waiting on accept() on a socket in the user space.
It receives a new connection and sends the socket descriptor down
to a module waiting for it in the kernel using ioctl().
The module gets the socket behind the descriptor using fget()
and socki_lookup() on the inode.
The module spawns a kernel thread that now reads from that socket.

Everything is working great even if the daemon now closes the new socket.
The session remains open and there is data transfer.

The problem is that if the deamon dies for whatever reason, the kernel thread
returns from the read with ERESTARTSYS and the socket can no longer be used.
I tried several things including raising the count on the inode and the file
structure. Nothing helped. I'de like my module to continue functioning even
after the daemon dies.

I'de appreciate any ideas.

TIA

-- 
************************************************
"When in doubt, use brute force."
									Ken Thompson
Etay Meiri
cl1@netvision.net.il
************************************************

                 reply	other threads:[~2001-11-05 21:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20011105234505.B17086@amber \
    --to=cl1@netvision.net.il \
    --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