Karel Zak [Mon, 4 Oct 2021 09:14:01 +0000 (11:14 +0200)]
fstrim: don't trigger autofs
- ignore read-only entries
- ignore autofs entries (for example from /proc/self/mountinfo)
- ignore autofs mountpoints where automounter has not been triggered yet
Fixes: https://github.com/karelzak/util-linux/issues/1463 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 1 Oct 2021 12:59:50 +0000 (14:59 +0200)]
su: reset RLIMIT_{NICE,RTPRIO} to zero
Addresses: https://github.com/linux-pam/linux-pam/issues/85 Reported-by: Lennart Poettering <lennart@poettering.net> Signed-off-by: Karel Zak <kzak@redhat.com>
Eduard Bloch [Mon, 27 Sep 2021 07:07:23 +0000 (09:07 +0200)]
Let user choose larger buffers for IO reading
Simultaneous reading of multiple files through a small one-page buffer
is slow with classic HDDs. Let the user improve it by chosing buffers of
several mebibytes if needed.
[kzak@redhat.com: - tiny changes to coding style
- mark buffers static
- use xalloc.h]
Signed-off-by: Eduard Bloch <blade@debian.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Both HiFive Unleashed and HiFive Unmatched bootloaders seek for the same
UUIDs to load the next stage bootloader: the current name makes partitions
on Unmatched board appear as 'Unleashed'.
Fix that by removing the 'Unleashed' part of the current naming so it
fits both.
Michael Kerrisk [Thu, 9 Sep 2021 00:08:27 +0000 (02:08 +0200)]
unshare.1.adoc: Improve wording re namespace creation
The terminonoly "unshare the namespace" is not very helpful.
Instead, use wording that explains what these options actually
fo: "create a new namespace".
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This avoids an extra syscall, and allows the kernel to automatically set
block size [0], avoiding unnecessary failure with 4096-byte devices.
This changes the observable behavior of losetup --direct-io in the case
where DIO is not supported to fully fail, instead of creating a
non-direct-io device. If the user explicitly specifies --direct-io, then
they should get either a DIO loopdev or no loopdev, not a non-DIO
loopdev and a misleading error.
Additionally, loopcxt_setup_device now uses O_CLOEXEC in the read-only
fallback.
Some parts of the Debian build infrastructure uses unshare to run the
package build, and that appears to cause a "nested" unshare in the
lsns/ioctl_ns test to fail. Unfortunately the tests then hang at this
point.
Try running unshare before the actual test, and skip the test if unshare
already fails.
[kzak@redhat.com: - add --fork to the test
- don't write to stdout/err]
Signed-off-by: Chris Hofstaedtler <zeha@debian.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 31 Aug 2021 09:57:30 +0000 (11:57 +0200)]
tests: use sub-tests for dm-verity
* write error to the test log file rather than on stdout
* use sub-tests to get more info on output
* don't use ts_die in sub-tests to make sure we call final dmsetup remove
Naohiro Aota [Mon, 30 Aug 2021 05:52:56 +0000 (14:52 +0900)]
lsblk: add columns of zoned parameters
Several parameters for zoned devices are missing from lsblk's columns. This
commit introduces them as following.
ZONE-SZ zone size
ZONE-WGRAN zone write granularity
ZONE-APP zone append max bytes
ZONE-NR number of zones
ZONE-OMAX maximum number of open zones
ZONE-AMAX maximum number of active zones
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Hans de Goede [Fri, 30 Jul 2021 11:22:54 +0000 (13:22 +0200)]
wdctl: Workaround reported boot-status bits not being present in wd->ident.options
Some watchdog drivers are capable of reporting WDIOF_CARDRESET in their
bootstatus, but they do not advertise this in the options field
returned by the WDIOC_GETSUPPORT ioctl.
This causes wdctl to not print the CARDRESET flag on these devices,
even when the reset was caused by the watchdog and this is being
reported in the WDIOC_GETBOOTSTATUS return.
Add a workaround by or-ing any bits which are set in the status and
bstatus returns into wd->ident.options so that reported flags will
get printend independent of them being advertised as supported in
wd->ident.options.
This will make wdctl print a CARDRESET line when the system was
actually reset by the watchdog while omitting it when it was not
reset by the watchdog. At least on drivers which have the
CARDRESET is missing from info.options problem. On other drivers
the CARDRESET line will always be printend, but the actual reported
value will change.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Jan Samek [Mon, 16 Aug 2021 19:22:15 +0000 (21:22 +0200)]
zramctl: add zstd compression algorithm option
Add information about the possible value 'zstd' for the 'zramctl --algorithm'
option to 'zramctl --help' and zramctl (8) manpage. The kernel supports zram
with zstd compression starting with 4.15 (see
https://lore.kernel.org/lkml/20170912050005.3247-1-sergey.senozhatsky@gmail.com/#r).
Karel Zak [Thu, 12 Aug 2021 10:12:39 +0000 (12:12 +0200)]
libmount: change propagation of /run for X-mount.subdir
We do not need to create a new mount node from /run/mount/tmptgt
(where we mount filesystem root), because /run is already mount
node in all mainstream distros, and we can use MS_PRIVATE for
this top-level directory. There is still fallback if /run is
on root filesystem.
This solution reduces number of mount operations, with the patch the
subdir implementation is:
* open current namespace from /proc/self/ns/mnt
* mkdir /run/mount/tmptg (if it does not exist)
* make /run private by mount(MS_PRIVATE)
* mount filesystem to /run/mount/tmptg
* bind mount /run/mount/tmptg/<subdir> to <target>
* umount /run/mount/tmptg
* setns() to the original namespace
Karel Zak [Thu, 12 Aug 2021 08:58:18 +0000 (10:58 +0200)]
libmount: use /run/mount/tmptgt rather than /tmp/mount/mount.<pid>
The unshared namespace is per-process, so we can use the same
directory in all mount(8) instances. It's unnecessary to create
and remove process specific directory.