From 0da425df6580684f286cb2c7ad84612841cc5797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 7 Jul 2020 11:51:29 +0200 Subject: [PATCH 1/4] networkd: use capitalized "IP" and "TOS" in messages --- src/network/netdev/bond.c | 10 +++++----- src/network/networkd-dhcp4.c | 12 ++++++------ src/network/networkd-routing-policy-rule.c | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c index 23bd3e1e46..8c1ba11e5f 100644 --- a/src/network/netdev/bond.c +++ b/src/network/netdev/bond.c @@ -327,7 +327,7 @@ int config_parse_arp_ip_target_address( r = extract_first_word(&rvalue, &n, NULL, 0); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, r, - "Failed to parse Bond ARP ip target address, ignoring assignment: %s", + "Failed to parse Bond ARP IP target address, ignoring assignment: %s", rvalue); return 0; } @@ -337,7 +337,7 @@ int config_parse_arp_ip_target_address( r = in_addr_from_string(AF_INET, n, &ip); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, r, - "Bond ARP ip target address is invalid, ignoring assignment: %s", n); + "Bond ARP IP target address is invalid, ignoring assignment: %s", n); continue; } @@ -347,7 +347,7 @@ int config_parse_arp_ip_target_address( if (ordered_set_size(b->arp_ip_targets) >= NETDEV_BOND_ARP_TARGETS_MAX) { log_syntax(unit, LOG_WARNING, filename, line, 0, - "Too many ARP ip targets are specified. The maximum number is %d. Ignoring assignment: %s", + "Too many ARP IP targets are specified. The maximum number is %d. Ignoring assignment: %s", NETDEV_BOND_ARP_TARGETS_MAX, n); continue; } @@ -355,10 +355,10 @@ int config_parse_arp_ip_target_address( r = ordered_set_put(b->arp_ip_targets, UINT32_TO_PTR(ip.in.s_addr)); if (r == -EEXIST) log_syntax(unit, LOG_WARNING, filename, line, r, - "Bond ARP ip target address is duplicated, ignoring assignment: %s", n); + "Bond ARP IP target address is duplicated, ignoring assignment: %s", n); if (r < 0) log_syntax(unit, LOG_ERR, filename, line, r, - "Failed to store bond ARP ip target address '%s', ignoring assignment: %m", n); + "Failed to store bond ARP IP target address '%s', ignoring assignment: %m", n); } } diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index 9a99c1e6f9..37b16315e5 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -1025,7 +1025,7 @@ static int dhcp_lease_ip_change(sd_dhcp_client *client, Link *link) { link->dhcp_lease_old = TAKE_PTR(link->dhcp_lease); - /* On ip address change, to keep the connectability, we would like to assign new address and + /* On IP address change, to keep the connectability, we would like to assign new address and * routes, and then release old lease. There are two possible success paths: * * 1. new address and routes are configured. @@ -1066,12 +1066,12 @@ static int dhcp_server_is_deny_listed(Link *link, sd_dhcp_client *client) { r = sd_dhcp_lease_get_server_identifier(lease, &addr); if (r < 0) - return log_link_debug_errno(link, r, "Failed to get DHCP server ip address: %m"); + return log_link_debug_errno(link, r, "Failed to get DHCP server IP address: %m"); if (set_contains(link->network->dhcp_deny_listed_ip, UINT32_TO_PTR(addr.s_addr))) { log_struct(LOG_DEBUG, LOG_LINK_INTERFACE(link), - LOG_LINK_MESSAGE(link, "DHCPv4 ip '%u.%u.%u.%u' found in deny-listed ip addresses, ignoring offer", + LOG_LINK_MESSAGE(link, "DHCPv4 IP '%u.%u.%u.%u' found in deny-listed IP addresses, ignoring offer", ADDRESS_FMT_VAL(addr))); return true; } @@ -1094,12 +1094,12 @@ static int dhcp_server_is_allow_listed(Link *link, sd_dhcp_client *client) { r = sd_dhcp_lease_get_server_identifier(lease, &addr); if (r < 0) - return log_link_debug_errno(link, r, "Failed to get DHCP server ip address: %m"); + return log_link_debug_errno(link, r, "Failed to get DHCP server IP address: %m"); if (set_contains(link->network->dhcp_allow_listed_ip, UINT32_TO_PTR(addr.s_addr))) { log_struct(LOG_DEBUG, LOG_LINK_INTERFACE(link), - LOG_LINK_MESSAGE(link, "DHCPv4 ip '%u.%u.%u.%u' found in allow-listed ip addresses, accepting offer", + LOG_LINK_MESSAGE(link, "DHCPv4 IP '%u.%u.%u.%u' found in allow-listed IP addresses, accepting offer", ADDRESS_FMT_VAL(addr))); return true; } @@ -1520,7 +1520,7 @@ int dhcp4_configure(Link *link) { if (link->network->ip_service_type > 0) { r = sd_dhcp_client_set_service_type(link->dhcp_client, link->network->ip_service_type); if (r < 0) - return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set ip service type: %m"); + return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set IP service type: %m"); } if (link->network->dhcp_fallback_lease_lifetime > 0) { diff --git a/src/network/networkd-routing-policy-rule.c b/src/network/networkd-routing-policy-rule.c index c4124c0906..035f006d35 100644 --- a/src/network/networkd-routing-policy-rule.c +++ b/src/network/networkd-routing-policy-rule.c @@ -506,17 +506,17 @@ int routing_policy_rule_configure(RoutingPolicyRule *rule, Link *link, link_netl if (rule->tos > 0) { r = sd_rtnl_message_routing_policy_rule_set_tos(m, rule->tos); if (r < 0) - return log_link_error_errno(link, r, "Could not set ip rule tos: %m"); + return log_link_error_errno(link, r, "Could not set IP rule TOS: %m"); } if (rule->table < 256) { r = sd_rtnl_message_routing_policy_rule_set_table(m, rule->table); if (r < 0) - return log_link_error_errno(link, r, "Could not set ip rule table: %m"); + return log_link_error_errno(link, r, "Could not set IP rule table: %m"); } else { r = sd_rtnl_message_routing_policy_rule_set_table(m, RT_TABLE_UNSPEC); if (r < 0) - return log_link_error_errno(link, r, "Could not set ip rule table: %m"); + return log_link_error_errno(link, r, "Could not set IP rule table: %m"); r = sd_netlink_message_append_u32(m, FRA_TABLE, rule->table); if (r < 0) @@ -698,7 +698,7 @@ int config_parse_routing_policy_rule_tos( r = safe_atou8(rvalue, &n->tos); if (r < 0) { - log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse RPDB rule tos, ignoring: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse RPDB rule TOS, ignoring: %s", rvalue); return 0; } @@ -1372,7 +1372,7 @@ int routing_policy_load_rules(const char *state_file, Set **rules) { } else if (streq(a, "tos")) { r = safe_atou8(b, &rule->tos); if (r < 0) { - log_error_errno(r, "Failed to parse RPDB rule tos, ignoring: %s", b); + log_error_errno(r, "Failed to parse RPDB rule TOS, ignoring: %s", b); continue; } } else if (streq(a, "table")) { From 8ab0f03266a2217d45bff90e6104164ca51cf1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 7 Jul 2020 11:56:32 +0200 Subject: [PATCH 2/4] journal/compress: drop "future" code in zstd compression We generally don't include stuff that is not used. This can be easily ressurected if ever needed. Fixes CID#1430210. --- src/journal/compress.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/journal/compress.c b/src/journal/compress.c index ec398e0cc1..e6ce64fc65 100644 --- a/src/journal/compress.c +++ b/src/journal/compress.c @@ -852,8 +852,6 @@ int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes) { size_t in_allocsize, out_allocsize; size_t z; uint64_t left = max_bytes, in_bytes = 0; - /* This can be used in the future to add uncompressed size to the header */ - uint64_t in_totalsize = 0; assert(fdf >= 0); assert(fdt >= 0); @@ -867,11 +865,6 @@ int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes) { if (!cctx || !out_buff || !in_buff) return -ENOMEM; - if (in_totalsize) { - z = ZSTD_CCtx_setPledgedSrcSize(cctx, in_totalsize); - if (z) - log_debug("Failed to enable ZSTD input size, ignoring: %s", ZSTD_getErrorName(z)); - } z = ZSTD_CCtx_setParameter(cctx, ZSTD_c_checksumFlag, 1); if (ZSTD_isError(z)) log_debug("Failed to enable ZSTD checksum, ignoring: %s", ZSTD_getErrorName(z)); From cd990847b9b7dc083443aa5f181e0a27ccde432e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 7 Jul 2020 12:08:22 +0200 Subject: [PATCH 3/4] tree-wide: more repeated words --- docs/USER_RECORD.md | 2 +- man/org.freedesktop.home1.xml | 2 +- man/sd_bus_get_fd.xml | 2 +- man/systemd.exec.xml | 2 +- src/core/unit.c | 2 +- src/shared/dropin.c | 4 ++-- src/shared/linux/nl80211.h | 2 +- src/test/test-process-util.c | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/USER_RECORD.md b/docs/USER_RECORD.md index 877d213e46..f6d22c217b 100644 --- a/docs/USER_RECORD.md +++ b/docs/USER_RECORD.md @@ -180,7 +180,7 @@ strictly local context and without signatures doesn't have to deal with the `perMachine` or `binding` sections and can include its data exclusively in the regular section. A service that uses a separate, private channel for authenticating users (or that doesn't have a concept of authentication at all) -does not need to to be concerned with the `secret` section of user records, as +does not need to be concerned with the `secret` section of user records, as the fields included therein are only useful when executing authentication operations natively against JSON user records. diff --git a/man/org.freedesktop.home1.xml b/man/org.freedesktop.home1.xml index f65ef33f21..dbfdd338d6 100644 --- a/man/org.freedesktop.home1.xml +++ b/man/org.freedesktop.home1.xml @@ -24,7 +24,7 @@ Introduction systemd-homed.service8 - is a system service which may be used to to create, remove, change or inspect home areas. This page + is a system service which may be used to create, remove, change or inspect home areas. This page describes the D-Bus interface. diff --git a/man/sd_bus_get_fd.xml b/man/sd_bus_get_fd.xml index 69261af93e..466606118b 100644 --- a/man/sd_bus_get_fd.xml +++ b/man/sd_bus_get_fd.xml @@ -79,7 +79,7 @@ POLLIN, POLLOUT, … events, or negative on error. - sd_bus_get_timeout() returns the timeout in µs to pass to to + sd_bus_get_timeout() returns the timeout in µs to pass to poll() or a similar call when waiting for events on the specified bus connection. The returned timeout may be zero, in which case a subsequent I/O polling call should be invoked in non-blocking mode. The returned timeout may be diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index b94bc2e4f4..6d6eca09a1 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -1699,7 +1699,7 @@ RestrictNamespaces=~cgroup net mount propagation is used, but — as mentioned — as is applied first, propagation from the unit's processes to the host is still turned off. - It is not recommended to to use mount propagation for units, as this means + It is not recommended to use mount propagation for units, as this means temporary mounts (such as removable media) of the host will stay mounted and thus indefinitely busy in forked off processes, as unmount propagation events won't be received by the file system namespace of the unit. diff --git a/src/core/unit.c b/src/core/unit.c index 18bf0cd52a..edc96537cb 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -258,7 +258,7 @@ int unit_add_name(Unit *u, const char *text) { t = unit_name_to_type(name); if (t < 0) return log_unit_debug_errno(u, SYNTHETIC_ERRNO(EINVAL), - "failed to to derive unit type from name '%s': %m", name); + "failed to derive unit type from name '%s': %m", name); if (u->type != _UNIT_TYPE_INVALID && t != u->type) return log_unit_debug_errno(u, SYNTHETIC_ERRNO(EINVAL), diff --git a/src/shared/dropin.c b/src/shared/dropin.c index 2693b63233..932da0c853 100644 --- a/src/shared/dropin.c +++ b/src/shared/dropin.c @@ -204,7 +204,7 @@ static int unit_file_find_dirs( type = unit_name_to_type(name); if (type < 0) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "Failed to to derive unit type from unit name: %s", + "Failed to derive unit type from unit name: %s", name); if (is_instance) { @@ -254,7 +254,7 @@ int unit_file_find_dropin_paths( type = unit_name_to_type(n); if (type < 0) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "Failed to to derive unit type from unit name: %s", n); + "Failed to derive unit type from unit name: %s", n); /* Special top level drop in for ".". Add this last as it's the most generic * and should be able to be overridden by more specific drop-ins. */ diff --git a/src/shared/linux/nl80211.h b/src/shared/linux/nl80211.h index beee59c831..b065c1fe4d 100644 --- a/src/shared/linux/nl80211.h +++ b/src/shared/linux/nl80211.h @@ -1435,7 +1435,7 @@ enum nl80211_commands { * rates as defined by IEEE 802.11 7.3.2.2 but without the length * restriction (at most %NL80211_MAX_SUPP_RATES). * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station - * to, or the AP interface the station was originally added to to. + * to, or the AP interface the station was originally added to. * @NL80211_ATTR_STA_INFO: information about a station, part of station info * given for %NL80211_CMD_GET_STATION, nested attribute containing * info as possible, see &enum nl80211_sta_info. diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c index d78e0544a7..b00dd4a980 100644 --- a/src/test/test-process-util.c +++ b/src/test/test-process-util.c @@ -636,7 +636,7 @@ static void test_setpriority_closest(void) { q = getpriority(PRIO_PROCESS, 0); assert_se(errno == 0 && p == q); - /* It should also be possible to to set the nice level to one higher */ + /* It should also be possible to set the nice level to one higher */ if (p < PRIO_MAX-1) { assert_se(setpriority_closest(++p) > 0); @@ -645,7 +645,7 @@ static void test_setpriority_closest(void) { assert_se(errno == 0 && p == q); } - /* It should also be possible to to set the nice level to two higher */ + /* It should also be possible to set the nice level to two higher */ if (p < PRIO_MAX-1) { assert_se(setpriority_closest(++p) > 0); From a53f024d7121d48ad48e0f1d9ad8004db9a08301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 7 Jul 2020 12:14:41 +0200 Subject: [PATCH 4/4] journald: minor wording tweak in message For a user "from the kernel" might be rather unclear. --- src/journal/journald-kmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c index 95aaf87876..6e7c806fd8 100644 --- a/src/journal/journald-kmsg.c +++ b/src/journal/journald-kmsg.c @@ -315,7 +315,7 @@ static int server_read_dev_kmsg(Server *s) { if (IN_SET(errno, EAGAIN, EINTR, EPIPE)) return 0; - return log_error_errno(errno, "Failed to read from kernel: %m"); + return log_error_errno(errno, "Failed to read from /dev/kmsg: %m"); } dev_kmsg_record(s, buffer, l);