diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-03-18 14:34:16 +1100 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-03-18 15:33:56 +1100 |
commit | 0752a75d2e37243245dbd6dfd3e512c6f25eca8c (patch) | |
tree | 22af194ade60340b0d64ba5f323de7cda87e9b1f | |
parent | c70e102425ecc261dc9fa740ce7e2296c5d39f4e (diff) | |
download | talos-petitboot-0752a75d2e37243245dbd6dfd3e512c6f25eca8c.tar.gz talos-petitboot-0752a75d2e37243245dbd6dfd3e512c6f25eca8c.zip |
discover: Increase udev monitor buffer size
Since we may be enumerating devices after enabling the udev monitor, we
may miss udev events that occur during this process.
This change increases the default udev buffer size.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r-- | discover/udev.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/discover/udev.c b/discover/udev.c index b1a25b3..656c5ab 100644 --- a/discover/udev.c +++ b/discover/udev.c @@ -26,6 +26,11 @@ #include "device-handler.h" #include "cdrom.h" +/* We set a default monitor buffer size, as we may not process monitor + * events while performing device discvoery. systemd uses a 128M buffer, so + * we'll do the same here */ +static const int monitor_bufsize = 128 * 1024 * 1024; + struct pb_udev { struct udev *udev; struct udev_monitor *monitor; @@ -355,6 +360,12 @@ static int udev_setup_monitor(struct udev *udev, struct udev_monitor **monitor) goto out_err; } + result = udev_monitor_set_receive_buffer_size(m, monitor_bufsize); + if (result) { + pb_log("udev_monitor_set_rx_bufsize(%d) failed\n", + monitor_bufsize); + } + result = udev_monitor_filter_add_match_subsystem_devtype(m, "block", NULL); |