Keeping the socket open in kernel after process exits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 -512 (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 appreciate any ideas.

TIA


-- 
************************************************
"When in doubt, use brute force."
									Ken Thompson
Etay Meiri
cl1@netvision.net.il
************************************************
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux