| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Standard cgroup harness for bpf feature.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On some conditions (particularly when mobile CPUs are going to sleep),
the posix_fallocate(), which is called when a new journal file is allocated,
can return -1 (EINTR). This is counted as a fatal error. So the journald
closes both old and journals, and simply throwing away further incoming
events, because of no log files open.
Introduce posix_fallocate_loop() that restarts the function in the case
of EINTR. Also let's make code base more uniform by returning negative
values on error.
Fix assert in test-sigbus.c that incorrectly counted positive values as
success. After changing the function return values, that will actually work.
Fixes: #19041
Signed-off-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far all file systems where checked by instances of
systemd-fsck@.service, with the exception of the root fs which was
covered by systemd-fsck-root.service. The special handling is necessary
to deal with ordering issues: we typically want the root fs to be
checked before all others, and — weirdly — allow mounting it before the
fsck done (for compat with initrd-less boots).
This adds similar special handling for /usr: if the hierarchy is placed
on a separate file system check it with a special
systemd-fsck-usr.service instead of a regular sysemd-fsck@.service
instance. Reason is again ordering: we want to allow mounting of /usr
without the root fs already being around in the initrd, to cover for
cases where the root fs is created on first boot and thus cannot be
mounted/checked before /usr.
|
|\
| |
| | |
network: dhcp6: add logs about delegated prefix
|
| | |
|
| | |
|
|\ \
| |/
|/| |
More shellcheck shenanigans
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the fstab-generator to handle mounting of /usr/ a bit
differently than before. Instead of immediately mounting the fs to
/sysroot/usr/ we'll first mount it to /sysusr/usr/ and then add a
separate bind mount that mounts it from /sysusr/usr/ to /sysroot/usr/.
This way we can access /usr independently of the root fs, without for
waiting to be mounted via the /sysusr/ hierarchy. This is useful for
invoking systemd-repart while a root fs doesn't exist yet and for
creating it, with partition data read from the /usr/ hierarchy.
This introduces a new generic target initrd-usr-fs.target that may be
used to generically order services against /sysusr/ to become available.
|
|
|
|
|
|
|
|
| |
EIO is used in other contexts, so change ot something otherwise unused.
ENOTRECOVERABLE was also suggested, but it's used in various other places
in the code.
https://github.com/systemd/systemd/pull/19317#discussion_r614887661
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes maybe-uninitialized warning:
```
../src/basic/fileio.c: In function ‘chase_symlinks_and_fopen_unlocked’:
../src/basic/fileio.c:1026:19: warning: ‘f’ may be used uninitialized in this function [-Wmaybe-uninitialized]
1026 | *ret_file = f;
| ~~~~~~~~~~^~~
```
|
|\
| |
| |
| |
| | |
yuwata/udev-ignore-additional-newline-on-verify-19314
udev: ignore additional newline at the end on verify
|
| |
| |
| |
| |
| | |
When writing a sysfs attribute, kernel may automatically append newline
at the end, e.g., 'portno' attribute for qeth driver.
|
|\ \
| |/
|/|
| |
| | |
keszybz/check-return-values-from-log_errno-functions
Check return values from log_errno functions
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As @yuwata correctly points out, this became broken when log_debug()
started returning -EIO. I wanted to preserve this pattern, but it turns
out it is not very widely used, and preserving it would make the whole
thing, already quite complicated, even more complex.
log_debug() is made like log_info() and friends, and returns void.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Let's assert if we ever happen to pass 0 to one of the log functions.
With the preceding commit to return -EIO from log_*(), passing 0 wouldn't
affect the return value any more, but it is still most likely an error.
The unit test code is an exception: we fairly often pass the return value
to print it, before checking what it is. So let's assert that we're not
passing 0 in non-test code. As with the previous check for %m, this is only
done in developer mode. We are depending on external code setting
errno correctly for us, which might not always be true, and which we can't
test, so we shouldn't assert, but just handle this gracefully.
I did a bunch of greps to try to figure out if there are any places where
we're passing 0 on purpose, and couldn't find any.
The one place that failed in tests is adjusted.
About "zerook" in the name: I wanted the suffix to be unambiguous. It's a
single "word" because each of the words in log_full_errno is also meaningful,
and having one term use two words would be confusing.
|
| |
| |
| |
| |
| |
| | |
This is only done in developer mode. It is a pretty rare occurence that we
make this kind of mistake. And even if it happens, the result is just a misleading
error message. So let's only do the check in non-release builds.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This silences some warnigns where gcc thinks that some variables are
unitialized. One particular case:
../src/journal/journald-server.c: In function 'ache_space_refresh':
../src/journal/journald-server.c:136:28: error: 'vfs_avail' may be used uninitialized in this function [-Werror=maybe-uninitialized]
136 | uint64_t vfs_used, vfs_avail, avail;
| ^~~~~~~~~
../src/journal/journald-server.c:136:18: error: 'vfs_used' may be used uninitialized in this function [-Werror=maybe-uninitialized]
136 | uint64_t vfs_used, vfs_avail, avail;
| ^~~~~~~~
cc1: all warnings being treated as errors
which is caused by
d = opendir(path);
if (!d)
return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR,
errno, "Failed to open %s: %m", path);
if (fstatvfs(dirfd(d), &ss) < 0)
return log_error_errno(errno, "Failed to fstatvfs(%s): %m", path);
For some reason on aarch64 gcc thinks we might return non-negative here. In
principle errno must be set in both cases, but it's hard to say for certain.
So let's make sure that our code flow is correct, even if somebody forgot to
set the global variable somewhere.
|
| |
| |
| |
| |
| |
| |
| | |
Using a enum is all nice and generic, but at this point it seems unlikely that
we'll add further build modes. But having an enum means that we need to include
the header file with the enumeration whenerever the conditional is used. I want
to use the conditional in log.h, which makes it hard to avoid circular imports.
|
|\ \
| |/
| | |
tree-wide: avoid uninitialized warning on _cleanup_ variables
|
| |
| |
| |
| |
| |
| |
| | |
With some versions of the compiler, the _cleanup_ attr makes it think
the variable might be freed/closed when uninitialized, even though it
cannot happen. The added cost is small enough to be worth the benefit,
and optimized builds will help reduce it even further.
|
|/ |
|
| |
|
|
|
|
|
| |
Add CGROUP_MASK_BPF_FOREIGN to CGROUP_MASK_BPF and standard cgroup
context harness.
|
|\
| |
| | |
Fix various issues reported by LGTM
|
| |
| |
| |
| |
| | |
We are not calling it directly, it's coming from a standard library
macro, so just suppress it.
|
| | |
|
| |
| |
| |
| |
| | |
Let's make this a bit more readable by implementing this via a
translation table, indexed by the state.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Let's define both an enum and a typedef named SpecialGlyph, the way we
usually do it.
Also, introduce an "invalid" special glyph, assigned to -EINVAL, also
like we always do it. (And handle it somewhat sanely in special_glyph()
|
|\ \
| |/
|/| |
meson: re-enable -Wmaybe-uninitialized
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This should make it easier to remove those warnings when the compiler
gets smarter. Not sure if I got them all...
Double space before the comment start to make it easier to separate from the
preceding line.
|
|\ \
| | |
| | | |
coredump: follow-ups for #19135
|
| |/ |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far when parsing /proc/cmdline we'd consider backslashes as
mechanisms for escaping whitepace or quotes. This changes things so that
they are retained as they are instead. The kernel itself doesn't allow such
escaping, and hence we shouldn't do so either (see lib/cmdline.c in the
kernel sources; it does support "" quotes btw).
This fix is useful to allow specifying backslash escapes in the "root="
cmdline option to be passed through to systemd-fstab-generator. Example:
root=/dev/disk/by-partlabel/Root\x20Partition
Previously we'd eat up the "\" so that we'd then look for a device
/dev/disk/by-partlabel/Rootx20Partition which never shows up.
|
|
|
|
|
|
|
| |
Let's ensure our key sizes calculations are correct.
This doesn't actually change anything, just adds more safety checks.
Inspired by #19203, but not a fix.
|
|
|
|
| |
AFAICT, gcc is just being stupid in all those cases.
|
|\
| |
| | |
Fix a bunch of maybe-unitialized warnings but don't enable the warning yet
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
[11/657] Compiling C object src/basic/libbasic.a.p/fileio.c.o
../src/basic/fileio.c: In function ‘write_string_stream_ts’:
../src/basic/fileio.c:167:21: warning: ‘fd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
167 | if (futimens(fd, twice) < 0)
| ^~~~~~~~~~~~~~~~~~~
|
| |
| |
| |
| |
| |
| |
| |
| | |
[59/1551] Compiling C object src/basic/libbasic.a.p/socket-util.c.o
../src/basic/socket-util.c: In function ‘socket_get_mtu’:
../src/basic/socket-util.c:1393:16: warning: ‘mtu’ may be used uninitialized in this function [-Wmaybe-uninitialized]
1393 | *ret = (size_t) mtu;
| ^~~~~~~~~~~~
|
|/
|
|
|
|
|
| |
Also change error message to be more meanigful. No change in
functionality.
Fixes: 0d96caa5c0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check the return code from gcrypt's functions. In some
cases just log, as it shoulnd't really happen.
Fixes various Coverity issues:
CID #1444702
CID #1444704
CID #1444706
CID #1444711
CID #1444712
CID #1444713
|
|
|
|
| |
Add new flag to allow kexec reboot if kernel is already loaded.
|
|\
| |
| | |
Make recursive bind remounting handle failures gracefully
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The various flavours of stat() basically tell us for free if something
is a symlink. If it is, then it's definitely not a mount point. Use
that.
All other inode types can be mount point, just symlinks cannot.
|
|\ \
| | |
| | | |
ordered-set: make ordered_set_put_strdup() allocate OrderedSet object
|