linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: embedded udev-81 doesn't remove node when fd open
Date: Fri, 22 Apr 2011 22:47:20 +0000	[thread overview]
Message-ID: <20110422224720.GA426@kroah.com> (raw)
In-Reply-To: <BANLkTinNZG9W3JrEMzWnQNrgCveDTswjdw@mail.gmail.com>

On Fri, Apr 22, 2011 at 03:34:52PM -0700, John Ervin wrote:
>  Hello,
> 
> Using udev-81 in an embedded system with 2.6.21 kernel (later versions
> of udev don't compile b/c of glibc version with cross compilation
> tools).

Wow, you do realize just how old both of those releases are, right?  If
you are stuck on those releases, then I suggest you get support from the
vendors or people who are forcing those versions on you, there's not
much we can do about it here, right?

> I need to keep the file descriptor of the device (a usb serial
> device) open to receive asynchronous data.
> 
> But, if the device is removed while the fd is open, udev doesn't
> remove the node. Any way to configure things so that udev removes the
> node, even while the fd is held open by user space program(s)?

That's because the device node is not gone, the kernel still sees it
being open, so it has not released it.

udev isn't involved here at all, so there's nothing it can do, it is
never notified of anything because nothing has changed in the kernel
yet.

Note, we did "help" this out in future kernel versions by sending a
HANGUP signal to userspace when the device went away, and you would get
that fix for free by updating to a newer kernel.

best of luck,

greg k-h

  reply	other threads:[~2011-04-22 22:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22 22:34 embedded udev-81 doesn't remove node when fd open John Ervin
2011-04-22 22:47 ` Greg KH [this message]
2011-04-22 23:03 ` John Ervin
2011-04-22 23:17 ` Greg KH

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=20110422224720.GA426@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-hotplug@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;
as well as URLs for NNTP newsgroup(s).