| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we first assign alternative names to a network interface,
then later change its main name if requested. So, we could not assign
the name that currently assigned as the main name of an interface as an
alternative name. So, we retry to assign the previous main name as an
alternative name on later move uevent.
However, that causes some confusing situation. E.g. if a .link file has
```
Name=foo
AlternativeNames=foo baz
```
then even if the interface is renamed by a user e.g. by invoking 'ip link'
command manually, the interface can be still referenced as 'foo', as the
name is now assigned as an alternative name.
This makes the order of name assignment inverse: the main name is first
changed, and then the requested alternative names are assigned. And
udevd do not assign alternative names on move uevent.
Replaces #27506.
|
| |
|
|
|
|
|
| |
On other uevents, the name will be anyway ignored in rename_netif() in
udev-event.c.
|
| |
|
|
|
|
| |
No functional change, preparation for later commits.
|
| |
|
| |
|
|
|
|
| |
Prompted by #27391.
|
| |
|
|\
| |
| | |
udev-rule: fix negative match
|
| |
| |
| |
| | |
Fixes #27396.
|
|\ \
| | |
| | | |
udev/iocost: several follow ups
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Then, the solution name can be logged.
|
| | |
| | |
| | |
| | |
| | | |
As these are always called sequentially.
No functional change, just refactoring.
|
| | | |
|
| | | |
|
| |/
| |
| |
| | |
And make the failure in parsing config critical.
|
|/
|
|
| |
Fixes #27382.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Meta's resource control demo project[0] includes a benchmark tool that can
be used to calculate the best iocost solutions for a given SSD.
[0]: https://github.com/facebookexperimental/resctl-demo
A project[1] has now been started to create a publicly available database
of results that can be used to apply them automatically.
[1]: https://github.com/iocost-benchmark/iocost-benchmarks
This change adds a new tool that gets triggered by a udev rule for any
block device and queries the hwdb for known solutions. The format for
the hwdb file that is currently generated by the github action looks like
this:
# This file was auto-generated on Tue, 23 Aug 2022 13:03:57 +0000.
# From the following commit:
# https://github.com/iocost-benchmark/iocost-benchmarks/commit/ca82acfe93c40f21d3b513c055779f43f1126f88
#
# Match key format:
# block:<devpath>:name:<model name>:
# 12 points, MOF=[1.346,1.346], aMOF=[1.249,1.249]
block:*:name:HFS256GD9TNG-62A0A:fwver:*:
IOCOST_SOLUTIONS=isolation isolated-bandwidth bandwidth naive
IOCOST_MODEL_ISOLATION=rbps=1091439492 rseqiops=52286 rrandiops=63784 wbps=192329466 wseqiops=12309 wrandiops=16119
IOCOST_QOS_ISOLATION=rpct=0.00 rlat=8807 wpct=0.00 wlat=59023 min=100.00 max=100.00
IOCOST_MODEL_ISOLATED_BANDWIDTH=rbps=1091439492 rseqiops=52286 rrandiops=63784 wbps=192329466 wseqiops=12309 wrandiops=16119
IOCOST_QOS_ISOLATED_BANDWIDTH=rpct=0.00 rlat=8807 wpct=0.00 wlat=59023 min=100.00 max=100.00
IOCOST_MODEL_BANDWIDTH=rbps=1091439492 rseqiops=52286 rrandiops=63784 wbps=192329466 wseqiops=12309 wrandiops=16119
IOCOST_QOS_BANDWIDTH=rpct=0.00 rlat=8807 wpct=0.00 wlat=59023 min=100.00 max=100.00
IOCOST_MODEL_NAIVE=rbps=1091439492 rseqiops=52286 rrandiops=63784 wbps=192329466 wseqiops=12309 wrandiops=16119
IOCOST_QOS_NAIVE=rpct=99.00 rlat=8807 wpct=99.00 wlat=59023 min=75.00 max=100.00
The IOCOST_SOLUTIONS key lists the solutions available for that device
in the preferred order for higher isolation, which is a reasonable
default for most client systems. This can be overriden to choose better
defaults for custom use cases, like the various data center workloads.
The tool can also be used to query the known solutions for a specific
device or to apply a non-default solution (say, isolation or bandwidth).
Co-authored-by: Santosh Mahto <santosh.mahto@collabora.com>
|
|
|
|
|
|
|
|
| |
Propagating $NOTIFY_SOCKET is typically dangerous. Let's unset it unless
explicitly requested to keep it.
Fixes #27288.
Replaces #27291.
|
| |
|
|\
| |
| | |
sd-device,udev: refuse unsafe path in SYMLINK= and TAG=
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
All tags are managed under /run/udev/tags, and the directories there are
named with tags. Hence, each tag must be a valid filename.
This also makes all validity check moved to sd-device side, and
makes failure caused by setting invalid tags non-critical.
With this change, an empty string cannot be assigned to TAG=, hence the
test cases are adjusted.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This is especially for the case that the path contains "..".
Prompted by https://github.com/systemd/systemd/pull/27164#issuecomment-1498863858.
This also makes SYMLINK= gracefully handle paths prefixed with "/dev/",
and manage devlink paths with path_hash_ops.
|
| |
| |
| |
| | |
No functional change, just refactoring.
|
| | |
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
proc-cmdline: filter PID1 arguments on container
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Otherwise, if getopt() and friends are used before parse_argv(), then
the GNU extensions may be ignored.
This should not change any behavior at least now, as we usually use
getopt_long() only once per invocation. But in the next commit,
getopt_long() will be used for other arrays, hence this change will
become necessary.
|
| |
| |
| |
| |
| | |
When invoked by udevadm verify, warn about rules that have PROGRAM
assignments specified after RESULT checks.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Make sure the ENOENT exception reintroduced by commit
9db7081d83d56cd2523b03f9eb9d67ef1c93c55f is not applied when the parser
is invoked by udevadm verify.
|
|/
|
|
|
|
|
|
|
| |
This reverts commit 42a467b55219384c7c3b137ab3cc8b6a309a8a14.
We need to skip -ENOENT when loading udev rules because new files with rules
may be added or removed at any time, and the loading of rules is triggered
asynchronously. Even though the window is fairly narrow, udev shouldn't throw
an error if a rules file is removed.
|
|
|
|
| |
Fixes: 25de7aa7b90c ("udev: modernize udev-rules.c")
|
|
|
|
|
|
|
| |
Log an error when a rule line contains the following kind of conflicting
match expressions:
KEY=="foo*", KEY=="bar*"
|
|
|
|
|
|
|
|
|
|
|
|
| |
When udev_rules_parse_file() is called by udevadm verify, issue warnings
about the following conditions in udev rules:
* the first token in the rule is preceded with a comma
* the last token in the rule is followed by a comma
* there is no comma between tokens
* there is no whitespace between tokens
* there is more than a single comma between tokens
* there is whitespace between a token and a comma
* there is no whitespace after comma
|
|
|
|
|
|
|
|
|
| |
Move udev_check_rule_line() invocation from udev_rule_file_get_issues()
to udev_rules_parse_file(), invoke udev_check_rule_line() only when
udev_rules_parse_file() is called by udevadm verify.
Subsequent commits are going to perform more checks invoked from
udev_rules_parse_file().
|
|
|
|
|
| |
Move udev_rules_parse_file() after udev_check_rule_line() as
the former us going to use the latter.
|
|
|
|
|
|
|
|
|
| |
Chasing symlinks is a core function that's used in a lot of places
so it deservers a less verbose names so let's rename it to chase()
and chaseat().
We also slightly change the pattern used for the chaseat() helpers
so we get chase_and_openat() and similar.
|
|\
| |
| | |
Implement --help/--version in all udev builtins
|
| |
| |
| |
| |
| |
| | |
The array is a union, aligned as uint16_t, so we were accessing fields at
offsets of two, so we didn't do actually do unaligned access. But let's make
this explicit.
|
| |
| |
| |
| |
| |
| | |
This is the usual set of flags. O_CLOEXEC doesn't matter because we don't spawn
anything, but O_NOCTTY could possibly make a difference if the helper is called
on a wrong device type.
|
| |
| |
| |
| |
| | |
They now pass, and we might as well test them to avoid unexpected
regressions.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Those are separate binaries, and occasionally people will get a misplaced
binary that doesn't match the rest of the installed system and be confused, so
it good to be able to check the version. It is also nice to have the same
interface in all binaries.
Note that we usually use a separate 'enum ARG_VERSION = 0x100' for an option
without a short name. We can use a less verbose approach of simply taking any
unused letter, which works just as well and even the compiler would warn us
if we tried to use the letter in another place. This way we avoid a few lines
of boilerplate.
The help texts are adjusted to have an empty line between the synopsis and
option list, and no empty lines after the option list.
|
| |
| |
| |
| | |
Copy-pasta is good, but you have to pick a reliable source.
|
| | |
|