sd-device-monitor: fix ordering of setting buffer size
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Jan 2019 20:24:54 +0000 (05:24 +0900)
committerMartin Pitt <mpitt@debian.org>
Mon, 18 Feb 2019 13:54:04 +0000 (13:54 +0000)
commit1d7f2d9511b413c9dacd920ca5d6b64720fe9c46
tree09393e97cf2669ed41f9195ab2d21bd716432e77
parent0e6680dcc6214f37488b5d72e5648a4e29a3ac67
sd-device-monitor: fix ordering of setting buffer size

By b1c097af8df58a94cba031a347061b7cb9b62d9b (#10239), the receive buffer
size for uevents was set by SO_RCVBUF at first, and fallback to
use SO_RCVBUFFORCE. So, as SO_RCVBUF limits to the buffer size
net.core.rmem_max, which is usually much smaller than 128MB udevd requests,
uevents buffer size was not sufficient.

This fixes the ordering of the request: SO_RCVBUFFORCE first, and
fallback to SO_RCVBUF. Then, udevd's uevent buffer size can be set to
128MB.

This also revert 903893237a2105b05671fe87b8f5d5e7417040d2.

Fixes #11314 and #10754.

(cherry picked from commit ee0b9e721a368742ac6fa9c3d9a33e45dc3203a2)

Gbp-Pq: Name sd-device-monitor-fix-ordering-of-setting-buffer-size.patch
src/libsystemd/sd-device/device-monitor.c