linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sleep 5 seconds and log a message if the signalfd(2) fd returns 0
@ 2009-10-25 18:16 Marco d'Itri
  0 siblings, 0 replies; only message in thread
From: Marco d'Itri @ 2009-10-25 18:16 UTC (permalink / raw)
  To: linux-hotplug

[-- 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 */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-25 18:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-25 18:16 sleep 5 seconds and log a message if the signalfd(2) fd returns 0 Marco d'Itri

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).