Karel Zak [Mon, 2 May 2022 10:57:13 +0000 (12:57 +0200)]
more: avoid infinite loop on --squeeze
The command 'echo | more -s' ends in infinite loop if exit-on-EOF is
disabled (default now). We need to call more_key_command() to ask for
user's reaction.
Fixes: https://github.com/util-linux/util-linux/issues/1669 Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (gpt) Add UUID for Marvell Armada 3700 Boot partition
This GPT UUID is used by BootROM on Marvell Armada 3700 SoC. BootROM
searches for GPT partition with this UUID on attached SATA disk and loads
bootloader from it.
Marvell Armada 3700 SoC is used e.g. on popular EspressoBIN SBC board which
has relatively solid Linux support.
Information about SATA booting and this GPT partition is currently
documented only in development version of ARM Trusted-Firmware-A
documentation:
Warner Losh [Fri, 29 Apr 2022 21:29:44 +0000 (15:29 -0600)]
BSD: Use byteswap.h and endian.h defined macos when present
Newer versions of FreeBSD will have a glibc compatible
byteswap.h. Currently, this file assumes that FreeBSD requires
bswap{16,32,64} to always be defined. This isn't the case when we're
using the byteswap.h file (which is enabled by HAVE_BYTESWAP_H
define). Assume that if byteswap.h and endian.h are present, then the
proper macros are defined. Otherwise, assume that sys/endian.h is
present and paper over the small differences between the BSDs for this
file.
libmount: when moving a mount point, all sub mount entries in utab should also be updated
Given that /run/mount/utab stores paths, this file needs to be adjusted when a
mount tree is moved.
However the moved tree may contains sub mount points in which case their utab
entries (if any) need to also be translated.
This patch takes care of that.
As suggested in https://github.com/systemd/systemd/issues/15266, a better
approach might be to store mount IDs instead of paths since mount IDs remain
unchanged when mount trees are moved.
Karel Zak [Wed, 20 Apr 2022 12:42:32 +0000 (14:42 +0200)]
dmesg: fix --since and --until
Now --since and --until requires any time field in the output (e.g.
--ctime,-T), it means "dmesg --since '1 day ago'" doesn't work, but
"dmesg -T --since '1 day ago'" works as expected.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2076829 Signed-off-by: Karel Zak <kzak@redhat.com>
lsns unconditionally uses NS_GET_NSTYPE since version 2.38 and
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=de72df79d72fa906e71e2ac922d8745ff22deee5
which is only available since kernel 4.11 and
https://github.com/torvalds/linux/commit/e5ff5ce6e20ee22511398bb31fb912466cf82a36
resulting in the following build failure:
sys-utils/lsns.c: In function 'add_namespace_for_nsfd':
sys-utils/lsns.c:719:25: error: 'NS_GET_NSTYPE' undeclared (first use in this function)
719 | clone_type = ioctl(fd, NS_GET_NSTYPE);
| ^~~~~~~~~~~~~
So add an option to allow the user to disable lsns
Karel Zak [Mon, 4 Apr 2022 13:59:36 +0000 (15:59 +0200)]
tests: make libmount tests more portable
git tree on macbook:
...
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:
Stanislav Brabec [Fri, 25 Mar 2022 08:26:48 +0000 (09:26 +0100)]
flock: Decribe limitations of flock: deadlock, NFS, CIFS
The flock(1) does not refer to limitations of flock(2). Provide an
documentation entry point for solving of problems with flock on NFS
and CIFS and mention risk of deadlock.
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
Andreas Hindborg [Wed, 16 Mar 2022 08:39:05 +0000 (09:39 +0100)]
blkzone: Do not print zone capacity if not supported
If `blkzone` is built against kernel headers that do not define
`BLK_ZONE_REP_CAPACITY`, `blkzone report` will use zone size when printing zone
capacity. This patch changes the behavior of `blockzone report` in this case to
omit the capacity field instead of using the potentially wrong value.
Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
Michael Trapp [Thu, 10 Mar 2022 12:18:52 +0000 (13:18 +0100)]
libuuid: extend cache in uuid_generate_time_generic()
Improve throughput and reduce clock sequence increments
for high load situation with time based version 1 uuids.
In a high load scenario, where an application continiously reads time
based version 1 uuids from uuidd, we have noticed the following
behaviour.
The application reads more uuids as there are available in the
corresponding timeframe and each bulk request results in an increment of
the clock sequence because of the 'step back' in time. Due to the
14bit size of the clock sequence this also results in overflows of
the clock sequence.
As uuidd calls
uuid_generate_time_safe()
uuid_generate_time_generic()
the default value for the bulk request in the '#ifdef HAVE_TLS' section
of uuid_generate_time_generic() is set to 1000.
Extending the 'cache' of uuid_generate_time_generic() by increasing
the default of num to 1000000 doesn't solve the issue, but reduces
the clock sequence increments by factor 1000 and it also improves
the uuid throughput in our setup by factor 3-4.
It might be possible to implement a cache for
UUIDD_OP_BULK_TIME_UUID
UUIDD_OP_TIME_UUID
in the uuidd request handling, but it would not be as simple as this fix
in uuid_generate_time_generic().