Commit Graph

10720 Commits

Author SHA1 Message Date
Jason S. McMullan
cf427188ad udev/net_id: Only read the first 64 bytes of PCI config space
The original code used fread(), which on some libc implementions
(ie glibc 2.17) would pre-read a full 4K (PAGE_SIZE) of the
PCI config space, when only 64 bytes were requested.

I have recently come across PCIe hardware which responds with
Completion Timeouts when accesses above 256 bytes are attempted.

This can cause server systems with GHES/AEPI support to cause
and immediate kernel panic due to the failed PCI transaction.

This change replaces the buffered fread() with an explict
unbuffered read() of 64 bytes, which corrects this issue by
only reading the guaranteed first 64 bytes of PCIe config space.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 09:39:35 -04:00
Anthony G. Basile
1713bd21e6 src/shared/path-util.c: import prefix_root() from upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 09:38:31 -04:00
Lennart Poettering
8943501993 nspawn: finish user namespace support
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 09:23:27 -04:00
Tom Gundersen
9aee6bf164 udevd: main - use _exit() when daemonizing
Makes it a bit clearer what is going on, rather than jumping to the end of main().

No functional change.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 08:44:53 -04:00
Anthony G. Basile
b831062ea7 Skip 'udevd: move file descriptors to Manager' and 'udevd: init/exit the builtins in manager_new/free'
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 08:32:14 -04:00
Lennart Poettering
c87734cd27 ata_id: drop spurious space
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 08:28:02 -04:00
Anthony G. Basile
04d6ad05a3 Skip 'udevd: queue - update queue state when events are queued/freed'
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 08:25:14 -04:00
Tom Gundersen
a5be4ae907 udevd: on_worker - distinguish between EINTR and EAGAIN
EAGAIN means there are no more messages to read, so give up. EINTR means we got interrupted
reading a message, so try again.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 08:21:49 -04:00
Anthony G. Basile
8ab818626d src/shared/util.h: import loop_write() from upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 08:16:14 -04:00
Tom Gundersen
233b58f3ac udevd: worker - use loop_write() rather than send()
When notifying the main daemon about event completion, make sure the message is sent
successfully, and not interrupted.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 07:46:12 -04:00
Tom Gundersen
b27de33448 udev-ctrl: make _unref() always return NULL
Bring this in line with the rest of the codebase.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 07:41:28 -04:00
Anthony G. Basile
f8f26ec383 Skip 'udevd: pass a Manager objcet to event handlers'
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 07:40:09 -04:00
Anthony G. Basile
52ad09b0bc Skip 'udevd: explicitly read out uevents we create ourselves'
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27 07:39:20 -04:00
Tom Gundersen
fb2906b467 udevd: remove stale comment
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 17:09:58 -04:00
Tom Gundersen
c0a12c12ba udevd: explicitly update queue file before answering to ping
This avoids updating the flag files twice for every loop, and also removes another dependency
in the main-loop, so we are freer to reshufle it as we want.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 17:05:57 -04:00
Anthony G. Basile
a23afd63bf Skip 'udevd: move to sd-event-style event handlers'
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 16:57:29 -04:00
Tom Gundersen
bed01621a6 udevd: make udev_ctrl_connection global
This allows us to simplify the ctrl_msg handler. Eventually all this global state should move to
a Manager object or so.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 16:27:38 -04:00
Torstein Husebø
7be67389a9 treewide: Correct typos and spell plural of bus consistent
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 16:24:16 -04:00
Thomas Hindoe Paaboel Andersen
7da1cec992 udevd: remove unused function
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 16:19:49 -04:00
Tom Gundersen
8d8a4087fb udevd: don't explicitly count the number of workers
Simply query the size of the hashmap keeping all the worker contexts instead.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 16:17:39 -04:00
Tom Gundersen
7d5298810a udevd: keep workers in a hashmap rather than a list
This makes the code somewhat more readable.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 13:18:16 -04:00
Tom Gundersen
1fc303749c udevd: worker - drop reference counting
Make the worker context have the same life-span as the worker process. It is created on fork()
and free'd on SIGCHLD.

The change means that we can get worker_returned() for a worker context that is no longer around,
this is not a problem and we can just drop the message. The only use for worker_returned() is to
know to reschedule events to workers that are still around, so if the worker has already exited
it is not important to keep track of. We still print a debug statement in this case to be on the
safe side.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 13:10:27 -04:00
David Herrmann
adf171757d udev: fix weird coding-style
Eeeew!

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 13:09:29 -04:00
Tom Gundersen
dae71aedd2 udevd: worker - allow passing NULL to worker_unref()
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 13:07:39 -04:00
Tom Gundersen
4e8a53c681 udevd: worker - use _exit() rather than exit()
Follow the coding style and avoid the exit handlers.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 13:06:58 -04:00
Anthony G. Basile
7b6429823b src/shared/util.[ch]: import functions from upstream for previous commits
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 12:55:38 -04:00
Tom Gundersen
5519f19a27 udevd: modernize error handling
We never return magic exit codes, but just EXIT_FAILUER or EXIT_SUCCESS.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 12:15:17 -04:00
Tom Gundersen
c05ef0c2e2 udevd: use kernel cmdline parser
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 11:44:59 -04:00
Anthony G. Basile
97862d1118 autogent: request automake 1.13 for gentoo
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 11:44:01 -04:00
Tom Gundersen
0aef2f056a udevd: worker - move some fields from the worker to the event
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 11:29:14 -04:00
Tom Gundersen
1571f27515 udevd: worker - introduce worker_attach_event()
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 11:28:08 -04:00
Tom Gundersen
0c804867b5 udevd: worker - make refcounting clearer
Take and drop explicit references where it makes sense.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 11:26:45 -04:00
Tom Gundersen
818b85cb3b udevd: worker - only allocate the worker struct in the main process
This is not used in the worker, so avoid having to free it there.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 11:25:42 -04:00
Tom Gundersen
1a332b3cd9 udevd: rename worker_new() to worker_spawn()
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 11:24:29 -04:00
Tom Gundersen
2024b4b263 udevd: don't track worker exitcode
We used to use this to track failed events so they could be retriggered,
but that is no longer done, so the code can be dropped.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 11:23:29 -04:00
Lennart Poettering
6fe5ac51c6 update hardware databases
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 10:27:22 -04:00
Peter Hutterer
1b8e79f601 hwdb: add MS Arc Touch Mouse SE
https://bugs.freedesktop.org/show_bug.cgi?id=90540

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 10:26:42 -04:00
Peter Hutterer
51421b5d8f hwdb: add Logitech M570 trackball
http://www.logitech.com/en-us/product/wireless-trackball-m570#specs
https://bugzilla.redhat.com/show_bug.cgi?id=1217881

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 10:26:00 -04:00
Hans de Goede
0bd129628e hwdb: Add trackpoint sensitivity setting for Thinkpad X230 tablet
This model needs the trackpoint sensitivity to be boosted to not be too slow
to be usable, see: https://bugzilla.redhat.com/show_bug.cgi?id=1200717

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26 09:55:21 -04:00
Andrew Hills
87c7c5d03b Update project URL in README 2015-05-24 16:39:38 -04:00
Lennart Poettering
8387ce96ff core: rework cgroup path parse logic
Various cleanups, be stricter when parsing unit paths.

Most importantly: return the root slice "-.slice" when asked for slice
of paths that contain no slice component.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04 14:19:24 -04:00
Thomas Hindoe Paaboel Andersen
1fdf69d5ef path-util: fix fstat fallback in fd_is_mount_point
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04 14:11:18 -04:00
Lennart Poettering
f238241644 sysctl: minor simplifications
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04 14:10:42 -04:00
Lennart Poettering
7da901811a path-util: make use of "mnt_id" field exported in /proc/self/fdinfo/<fd> to test for mount points
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04 14:06:38 -04:00
Anthony G. Basile
06065060a8 udevd: skip fix REMOVE handling
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04 14:02:05 -04:00
Martin Pitt
506d0b092e util: Fix assertion in split() on missing '
When parsing a unit with a trailing slash after an escaped line break, like

  ExecStart=/bin/echo 'foo \
    bar'

the split() function (through config_parse()) asserted and crashed pid 1:

  Assertion 'current[*l + 1] == quotechars[0]' failed at ../src/shared/util.c:583, function split(). Aborting.

Fix this by returning an error in this case ("trailing garbage").

Add corresponding test case. Also fix the missing "unit" argument of
config_parse_exec() in the comment.

https://launchpad.net/bugs/1447243
2015-05-04 14:01:33 -04:00
Zbigniew Jędrzejewski-Szmek
0485a848a3 shared/hashmap: normalize whitespace
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 16:23:01 -04:00
Tom Gundersen
349ade7cf2 udevd: worker - log if worker result cannot be sent
If the main daemon is not notified about a worker finishing an event
the refcounting of the worker struct will be wrong, and we will lose
track of the number of children we have to wait for.

This should not happen, but if it does we better complain loudly about
it. Worst case udev will wait for 30 seconsd at shutdown waiting for
nonexistent workers.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 16:07:21 -04:00
Tom Gundersen
adfa2ca4d5 udevd: worker - warn if unknown worker returns
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 16:06:45 -04:00
Anthony G. Basile
93fc111c3c src/udev/udevd.c: remove initializer for struct for gcc-4.5.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 16:04:43 -04:00