lkml.org 
[lkml]   [2001]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectkeeping the socket open in the kernel
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
************************************************
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:12    [W:0.032 / U:2.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site