From: Martin Sustrik <sustrik@250bpm.com>
To: netdev@vger.kernel.org
Cc: Martin Lucina <mato@kotelna.sk>
Subject: Polling on sockets in kernel space and struct file
Date: Wed, 08 Dec 2010 15:33:59 +0100 [thread overview]
Message-ID: <4CFF9757.3070100@250bpm.com> (raw)
Hi all,
As part of implementing a new experimental protocol family, we are
trying to create a socket in kernel. This seems to be easy, just use
sock_create_kern(). However, the socket returned by this function does
not have associated file structure; thus it cannot be polled on using
poll_initwait() and friends.
We have tried to create the appropriate struct file using sock_map_fd(),
but this has two problems:
1) We do not want our internal socket to be visible in the process
context, i.e. it should not have a file descriptor.
2) During process exit, we get a kernel BUG from iput() in fs/inode.c:1260.
We then tried another approach using anon_inode_getfile() to get a
struct file, but this still produces the problem 2) above.
Any help/advice on how to proceed would be appreciated; for reference
our work in progress can be seen at
http://github.com/sustrik/linux-2.6/blob/sp-v2.6.36/net/sp/af_sp.c
Thanks,
Martin
next reply other threads:[~2010-12-08 14:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-08 14:33 Martin Sustrik [this message]
2010-12-08 15:02 ` Polling on sockets in kernel space and struct file Eric Dumazet
2010-12-08 15:16 ` Martin Lucina
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=4CFF9757.3070100@250bpm.com \
--to=sustrik@250bpm.com \
--cc=mato@kotelna.sk \
--cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.