linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: md@Linux.IT (Marco d'Itri)
To: linux-hotplug@vger.kernel.org
Subject: sleep 5 seconds and log a message if the signalfd(2) fd returns 0
Date: Sun, 25 Oct 2009 18:16:22 +0000	[thread overview]
Message-ID: <20091025181622.GA30566@bongo.bofh.it> (raw)

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

This is better than just failing because it is quite annoying for the
admin when udevd fails to start while it is being upgraded and breaks
the system.

-- 
ciao,
Marco

[-- Attachment #2: sleep_on_broken_signalfd --]
[-- Type: text/plain, Size: 710 bytes --]

Sleep 5 seconds and log a message if the signalfd(2) fd returns 0.

Users running 2.6.22 kernels reported udevd spinning in a loop with the
signalfd fd reported as readable but providing no data.
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=551743 for details.

--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -1076,6 +1076,10 @@ int main(int argc, char *argv[])
 			size = read(pfd[FD_SIGNAL].fd, &fdsi, sizeof(struct signalfd_siginfo));
 			if (size == sizeof(struct signalfd_siginfo))
 				handle_signal(udev, fdsi.ssi_signo);
+			else {
+				err(udev, "read(2) on the signalfd(2) fd returned 0: your kernel is buggy!\n");
+				sleep(5);
+			}
 		}
 
 		/* device node and rules directory inotify watch */

                 reply	other threads:[~2009-10-25 18:16 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=20091025181622.GA30566@bongo.bofh.it \
    --to=md@linux.it \
    --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).