]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
23 months agoadd padding to dates in issue file
bobbyboy5069 [Fri, 24 Jun 2022 20:02:15 +0000 (23:02 +0300)] 
add padding to dates in issue file

Pad the day of the month so the length of the date string doesn't change.

23 months agoMerge branch 'master' of https://github.com/blacknon/util-linux
Karel Zak [Tue, 21 Jun 2022 07:38:03 +0000 (09:38 +0200)] 
Merge branch 'master' of https://github.com/blacknon/util-linux

* 'master' of https://github.com/blacknon/util-linux:
  update. Since the specified column is shifted by one column, subtract it.

23 months agotests: (lsfd) update the expected output for "test_mkfds symlink"
Masatake YAMATO [Mon, 20 Jun 2022 13:56:22 +0000 (22:56 +0900)] 
tests: (lsfd) update the expected output for "test_mkfds symlink"

Though the code of lsfd was changed in 4b496e50ee4f6bd8256d082a85fc027a7eaa45cb,
the expected output of the test case was not updated.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
23 months agoupdate. Since the specified column is shifted by one column, subtract it.
blacknon [Mon, 20 Jun 2022 13:56:00 +0000 (22:56 +0900)] 
update. Since the specified column is shifted by one column, subtract it.

23 months agohardlink: use info rather than warning message
Karel Zak [Mon, 20 Jun 2022 12:00:38 +0000 (14:00 +0200)] 
hardlink: use info rather than warning message

Fixes: https://github.com/util-linux/util-linux/issues/1710
Signed-off-by: Karel Zak <kzak@redhat.com>
23 months agosfdiks: (man) fix example
Karel Zak [Mon, 20 Jun 2022 11:42:35 +0000 (13:42 +0200)] 
sfdiks: (man) fix example

Fixes: https://github.com/util-linux/util-linux/discussions/1719
Signed-off-by: Karel Zak <kzak@redhat.com>
23 months agocolumn: support ranges when addressing columns by numbers
Karel Zak [Mon, 20 Jun 2022 11:25:59 +0000 (13:25 +0200)] 
column: support ranges when addressing columns by numbers

Fixes: https://github.com/util-linux/util-linux/issues/1723
Signed-off-by: Karel Zak <kzak@redhat.com>
23 months agoMerge branch 'lsfd-fix-contatns-for-decode-flags' of https://github.com/masatake...
Karel Zak [Mon, 20 Jun 2022 10:44:36 +0000 (12:44 +0200)] 
Merge branch 'lsfd-fix-contatns-for-decode-flags' of https://github.com/masatake/util-linux

* 'lsfd-fix-contatns-for-decode-flags' of https://github.com/masatake/util-linux:
  lsfd: fix wrongly checked flag constants

23 months agoMerge branch 'fix-github-issue-1720' of https://github.com/masatake/util-linux
Karel Zak [Mon, 20 Jun 2022 10:43:31 +0000 (12:43 +0200)] 
Merge branch 'fix-github-issue-1720' of https://github.com/masatake/util-linux

* 'fix-github-issue-1720' of https://github.com/masatake/util-linux:
  lsfd: try including asm/fcntl.h first for decoding flags of fdinfo

23 months agoMerge branch 'fix-github-issue-1717' of https://github.com/masatake/util-linux
Karel Zak [Mon, 20 Jun 2022 10:40:59 +0000 (12:40 +0200)] 
Merge branch 'fix-github-issue-1717' of https://github.com/masatake/util-linux

23 months agolibmount: remove mtab locking
Karel Zak [Fri, 17 Jun 2022 16:04:06 +0000 (18:04 +0200)] 
libmount: remove mtab locking

Signed-off-by: Karel Zak <kzak@redhat.com>
23 months agolsfd: fix wrongly checked flag constants
Masatake YAMATO [Fri, 17 Jun 2022 15:48:41 +0000 (00:48 +0900)] 
lsfd: fix wrongly checked flag constants

The definition of O_FOLLOW was checked. However, it was
a typo of O_NOFOLLOW.

The definition of O_FASYNC was checked. However, it was
a typo of FASYNC.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
23 months agolibmount: remove mtab related code
Karel Zak [Fri, 17 Jun 2022 15:45:29 +0000 (17:45 +0200)] 
libmount: remove mtab related code

Signed-off-by: Karel Zak <kzak@redhat.com>
23 months agolsfd: try including asm/fcntl.h first for decoding flags of fdinfo
Masatake YAMATO [Fri, 17 Jun 2022 15:28:38 +0000 (00:28 +0900)] 
lsfd: try including asm/fcntl.h first for decoding flags of fdinfo

Close #1720

The original code tried including asm-generic/fcntl.h before trying
including asm/fcntl.h. This caused a bug in decoding flag of fdinfo
on Linux running on armv7l.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
23 months agolibmount: remove support for writable /etc/mtab
Karel Zak [Fri, 17 Jun 2022 11:42:11 +0000 (13:42 +0200)] 
libmount: remove support for writable /etc/mtab

This commit removes --enable-libmount-support-mtab.

The classic /etc/mtab is broken by design. It does not support
namespaces, chroots, etc. The only sane way to keep track of
mounted filesystems is to ask the kernel. It's a bad idea to maintain
a mount table in userspace.

Signed-off-by: Karel Zak <kzak@redhat.com>
23 months agotest: (lsfd) ignore noatime mnt flag when testing a fd opening / directory
Masatake YAMATO [Thu, 16 Jun 2022 13:42:12 +0000 (22:42 +0900)] 
test: (lsfd) ignore noatime mnt flag when testing a fd opening / directory

Close #1717.

If the file system where the target directory is is mounted with
"noatime" flag, Linux kernel may set O_NOATIME to the fd associated
with the target directory. As a result, mkfds-directory test failed.

With this change, mkfds-directory deletes "noatime" from the output
of lsfd before verifying the output if "noatime" mount flag is set
to the file system where the directory opened by mkfds-directory is.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
23 months agomore: (man) add note about POSIXLY_CORRECT
Karel Zak [Wed, 15 Jun 2022 08:15:53 +0000 (10:15 +0200)] 
more: (man) add note about POSIXLY_CORRECT

Signed-off-by: Karel Zak <kzak@redhat.com>
23 months agomore: restore exit-on-eof if POSIXLY_CORRECT is not set
Karel Zak [Wed, 15 Jun 2022 08:03:44 +0000 (10:03 +0200)] 
more: restore exit-on-eof if POSIXLY_CORRECT is not set

In version 2.38, exit-on-eof has been disabled by default. This change
is annoying for users and forces many users to use 'alias more="more
-e"'. It seems better to force POSIX lovers to use POSIXLY_CORRECT
env. variable and stay backwardly compatible by default.

Addresses: https://github.com/util-linux/util-linux/issues/1703
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2088493
Signed-off-by: Karel Zak <kzak@redhat.com>
23 months agobuild-sys: don't call AC_SUBST() if unnecessary
Karel Zak [Tue, 14 Jun 2022 14:13:03 +0000 (16:13 +0200)] 
build-sys: don't call AC_SUBST() if unnecessary

Signed-off-by: Karel Zak <kzak@redhat.com>
23 months agobuild-sys: use PKG_CHECK_VAR()
Karel Zak [Tue, 14 Jun 2022 13:47:05 +0000 (15:47 +0200)] 
build-sys: use PKG_CHECK_VAR()

Do not call 'PKG_CONFIG --exists' and '$PKG_CONFIG --variable' if
there is a much more robust PKG_CHECK_VAR() macro.

It's also not necessary to check for the dirs if all the feature
(systemd or bashcompletiondir) is disabled.

Reported-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'fix-github-issue-1709' of https://github.com/masatake/util-linux
Karel Zak [Mon, 13 Jun 2022 10:16:39 +0000 (12:16 +0200)] 
Merge branch 'fix-github-issue-1709' of https://github.com/masatake/util-linux

* 'fix-github-issue-1709' of https://github.com/masatake/util-linux:
  lsfd: use constants defined in asm/fctl.h flags field of a fdinfo

2 years agoinclude/c: add prefix to print_features()
Karel Zak [Mon, 13 Jun 2022 10:10:51 +0000 (12:10 +0200)] 
include/c: add prefix to print_features()

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agohardlink: print supported feature on --version
Karel Zak [Mon, 13 Jun 2022 10:03:26 +0000 (12:03 +0200)] 
hardlink: print supported feature on --version

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolib/fileeq: clean up ifdefs use
Karel Zak [Mon, 13 Jun 2022 10:02:49 +0000 (12:02 +0200)] 
lib/fileeq: clean up ifdefs use

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoinclude/c: add print_version_with_features()
Karel Zak [Mon, 13 Jun 2022 10:01:51 +0000 (12:01 +0200)] 
include/c: add print_version_with_features()

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'change-default-comparison-method' of https://github.com/DrHyde/util...
Karel Zak [Mon, 13 Jun 2022 09:17:35 +0000 (11:17 +0200)] 
Merge branch 'change-default-comparison-method' of https://github.com/DrHyde/util-linux

* 'change-default-comparison-method' of https://github.com/DrHyde/util-linux:
  change the default comparison method on Mac OS to suppress a warning that's going to fall back to memcmp

2 years agolibblkid: (swap) fix magic string memcmp [fuzzing]
Karel Zak [Mon, 13 Jun 2022 08:34:52 +0000 (10:34 +0200)] 
libblkid: (swap) fix magic string memcmp [fuzzing]

Reported-by: Thibault Guittet <tguittet@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsfd: use constants defined in asm/fctl.h flags field of a fdinfo
Masatake YAMATO [Wed, 8 Jun 2022 15:32:19 +0000 (00:32 +0900)] 
lsfd: use constants defined in asm/fctl.h flags field of a fdinfo

Close #1709.

The original code decoded the field using constants defined in
/usr/include/fcntl.h. The constants defined in /usr/include/fcntl.h
was suitable for passing to the kernel as a part of arguments of
system calls like open(2). However, they were not suitable for
decoding the field.

Let's think about decoding 0300000 in

    $ cat /proc/157067/fdinfo/3
    pos: 0
    flags: 0300000
    $ lsfd -p 157067 -o+flags -Q -Q 'ASSOC == "3"'
    COMMAND       PID USER ASSOC MODE TYPE SOURCE MNTID INODE NAME               FLAGS
    test_mkfds 125128  jet     3  r--  DIR   dm-0    96    96 /    ???????????????????

The decoded string is printed at ???????????????????.

Quoted from /usr/include/bits/fcntl-linux.h:

    #ifndef __O_LARGEFILE
    # define __O_LARGEFILE 0100000
    #endif
    #ifndef __O_DIRECTORY
    # define __O_DIRECTORY 0200000
    #endif
    #ifndef __O_TMPFILE
    # define __O_TMPFILE   (020000000 | __O_DIRECTORY)
    #endif
    ...
    #ifdef __USE_XOPEN2K8
    # define O_DIRECTORY __O_DIRECTORY /* Must be a directory.  */
    ...
    #endif
    ...
    #ifdef __USE_LARGEFILE64
    # define O_LARGEFILE __O_LARGEFILE
    #endif

With these constants, 0300000 is decoded as "directory,_tmpfile" or
"largefile,directory,_tmpfile".

Unexpectedly the decoded string has "_tmpfile".
It has "largefile" only when we define __USE_LARGEFILE64 when building
lsfd though it should have "largefile" always.

Quoted from /usr/include/asm-generic/fcntl.h:

    #ifndef O_LARGEFILE
    #define O_LARGEFILE 00100000
    #endif
    #ifndef O_DIRECTORY
    #define O_DIRECTORY 00200000 /* must be a directory */
    #endif
    #ifndef __O_TMPFILE
    #define __O_TMPFILE 020000000
    #endif

The decoded string is "largefile,directory". It doesn't depend on
__USE_LARGEFILE64.

This change adds lsfd-decode-file-flags.c, a new small and isolated
source file, in which lsfd_decode_file_flags(), the function for
decoding the field is defined.

include/c.h includes /usr/include/fcntl.h. Almost all lsfd related
source files includes include/c.h indirectly. On the other hand,
lsfd-decode-file-flags.c includes only /usr/include/asm-generic/fcntl.h
or /usr/include/asm/fcntl.h. So the function can decode the field
expectedly.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agochange the default comparison method on Mac OS to suppress a warning that's going...
David Cantrell [Thu, 9 Jun 2022 18:13:01 +0000 (19:13 +0100)] 
change the default comparison method on Mac OS to suppress a warning that's going to fall back to memcmp

2 years agotests: (hardlink) remove runtime depend output
Karel Zak [Wed, 8 Jun 2022 09:50:04 +0000 (11:50 +0200)] 
tests: (hardlink) remove runtime depend output

The Method: field depends on kernel crypto support, otherwise hardlink
falls back to memcpy().

Fixes: https://github.com/util-linux/util-linux/issues/1710
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agocolumn: improve --table-hide
Karel Zak [Wed, 8 Jun 2022 09:31:57 +0000 (11:31 +0200)] 
column: improve --table-hide

This option affects list of visible columns, so it's better to apply
it before any other flags, because "-1" placeholder depends on visible
columns. For example:

echo "A B C D" | column --table --table-maxout --table-right -1 --table-hide 4

needs to hide column #4 (D) and align #3 (C) to the right.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agocolumn: add -1 placeholder to address last visible column
Karel Zak [Wed, 8 Jun 2022 09:28:02 +0000 (11:28 +0200)] 
column: add -1 placeholder to address last visible column

Addresses: https://github.com/util-linux/util-linux/issues/1700
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agocolumn: fix "0" placeholder
Karel Zak [Wed, 8 Jun 2022 09:07:58 +0000 (11:07 +0200)] 
column: fix "0" placeholder

Addresses: https://github.com/util-linux/util-linux/issues/1700
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: fix compilation
Karel Zak [Wed, 8 Jun 2022 08:44:03 +0000 (10:44 +0200)] 
libmount: fix compilation

Fixes: https://github.com/util-linux/util-linux/issues/1711
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsblk: fix memory leak and unnecessary allocation
Karel Zak [Tue, 7 Jun 2022 07:57:01 +0000 (09:57 +0200)] 
lsblk: fix memory leak and unnecessary allocation

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolslogins: fix free(): invalid pointer
Karel Zak [Tue, 7 Jun 2022 07:46:54 +0000 (09:46 +0200)] 
lslogins: fix free(): invalid pointer

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolslogins: improve prefixes interpretation
Karel Zak [Tue, 7 Jun 2022 07:11:56 +0000 (09:11 +0200)] 
lslogins: improve prefixes interpretation

It seems that for example 'passwd --lock' uses two exclamation marks
in password  field. It seems better to assume arbitrary number of '!'
and '*' prefixes.

The patch also makes description of the PWD-EMPTY output field more
explicit.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2093166
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agozramctl: fix compiler warning [-Werror=maybe-uninitialized]
Karel Zak [Mon, 6 Jun 2022 14:19:16 +0000 (16:19 +0200)] 
zramctl: fix compiler warning [-Werror=maybe-uninitialized]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsfd: fix compiler warning [-Werror=maybe-uninitialized]
Karel Zak [Mon, 6 Jun 2022 14:15:43 +0000 (16:15 +0200)] 
lsfd: fix compiler warning [-Werror=maybe-uninitialized]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoirqtop: fix compiler warning [-Werror=format-truncation=]
Karel Zak [Mon, 6 Jun 2022 14:14:30 +0000 (16:14 +0200)] 
irqtop: fix compiler warning [-Werror=format-truncation=]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolib/logindefs: fix compiler warning [-Werror=format-truncation=]
Karel Zak [Mon, 6 Jun 2022 14:14:14 +0000 (16:14 +0200)] 
lib/logindefs: fix compiler warning [-Werror=format-truncation=]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsblk: simplify code by ul_path_count_dirents()
Karel Zak [Mon, 6 Jun 2022 10:36:13 +0000 (12:36 +0200)] 
lsblk: simplify code by ul_path_count_dirents()

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsblk: enable 'MQ' for NVMe/virtio by default
zhenwei pi [Fri, 3 Jun 2022 12:24:02 +0000 (20:24 +0800)] 
lsblk: enable 'MQ' for NVMe/virtio by default

NVMe/virtio devices typically has MQ feature, enable this column by
default for option '--nvme/--virtio'.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2 years agolsblk: introduce 'MQ' column
zhenwei pi [Fri, 3 Jun 2022 12:24:01 +0000 (20:24 +0800)] 
lsblk: introduce 'MQ' column

Typically a modern block device supports mutil queues feature, count
queues by walking '$sysfs/mq' directory. If no '$sysfs/mq' exists, it
is a legacy single queue.

~# lsblk --nvme -o NAME,TYPE,MODEL,TRAN,RQ-SIZE,MQ
NAME    TYPE MODEL                      TRAN   RQ-SIZE  MQ
nvme0n1 disk INTEL SSDPF2KX038TZ        nvme      1023 135
nvme3n1 disk INTEL SSDPE2KX020T8        nvme      1023 128
nvme1n1 disk SAMSUNG MZQL23T8HCLS-00A07 nvme      1023 129
nvme2n2 disk RP2A03T8RK004LX            nvme      1023  64
nvme2n3 disk RP2A03T8RK004LX            nvme      1023  64

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2 years agolsblk: add -v/--virtio
zhenwei pi [Fri, 3 Jun 2022 12:24:00 +0000 (20:24 +0800)] 
lsblk: add -v/--virtio

Add -v/--virtio to filter the virtio block devices.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2 years agolsblk: support virtio block
zhenwei pi [Fri, 3 Jun 2022 12:23:59 +0000 (20:23 +0800)] 
lsblk: support virtio block

virtio blk is quite popular in the virtual machines, support 'TRAN'
column for a virtio block device.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2 years agolsblk: add -N/--nvme
zhenwei pi [Fri, 3 Jun 2022 12:23:58 +0000 (20:23 +0800)] 
lsblk: add -N/--nvme

Add -N/--nvme to filter NVMe device only, NVMe usually has a larger
I/O depth, also show COL_RQ_SIZE by default.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2 years agotests: (pipesz) use helper to get pagesize
Karel Zak [Mon, 6 Jun 2022 10:23:36 +0000 (12:23 +0200)] 
tests: (pipesz) use helper to get pagesize

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopipesz: use native PAGE_SIZE in tests
Nathan Sharp [Sat, 4 Jun 2022 02:00:22 +0000 (20:00 -0600)] 
pipesz: use native PAGE_SIZE in tests

Reported-by: Anatoly Pugachev <matorola@gmail.com>
Signed-off-by: Nathan Sharp <nwsharp@live.com>
2 years agolibblkid: minor changes to coding style
Karel Zak [Mon, 6 Jun 2022 10:14:10 +0000 (12:14 +0200)] 
libblkid: minor changes to coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'add/btrfs-ext-fslastblock' of https://github.com/alberand/util-linux
Karel Zak [Mon, 6 Jun 2022 10:10:45 +0000 (12:10 +0200)] 
Merge branch 'add/btrfs-ext-fslastblock' of https://github.com/alberand/util-linux

* 'add/btrfs-ext-fslastblock' of https://github.com/alberand/util-linux:
  libblkid: add FSSIZE implementation for btrfs and ext

2 years agocolumn: add --table-maxout
Karel Zak [Mon, 6 Jun 2022 09:41:35 +0000 (11:41 +0200)] 
column: add --table-maxout

Add option to fill all available space.

Fizes: https://github.com/util-linux/util-linux/issues/1700
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agouuidd: remove also PrivateNetwork=yes from systemd service
Karel Zak [Fri, 3 Jun 2022 07:07:09 +0000 (09:07 +0200)] 
uuidd: remove also PrivateNetwork=yes from systemd service

Fixes: https://github.com/util-linux/util-linux/issues/1704
References: 304b4dc4936b115ca33af5325c3b04d0997c1353
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agouuidd: allow AF_INET in systemd service
Karel Zak [Thu, 2 Jun 2022 14:55:49 +0000 (16:55 +0200)] 
uuidd: allow AF_INET in systemd service

libuuid uses

socket(AF_INET, SOCK_DGRAM, IPPROTO_IP)

to get MAC address for time based UUIDs, but there is

RestrictAddressFamilies=AF_UNIX

in uuidd service file ...

Fixes: https://github.com/util-linux/util-linux/issues/1704
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: (hfs) fix make sure buffer is large enough
Karel Zak [Thu, 2 Jun 2022 14:02:54 +0000 (16:02 +0200)] 
libblkid: (hfs) fix make sure buffer is large enough

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: (hfs) fix label use [fuzzing]
Karel Zak [Thu, 2 Jun 2022 14:02:54 +0000 (16:02 +0200)] 
libblkid: (hfs) fix label use [fuzzing]

Reported-by: Thibault Guittet <tguittet@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: (bsd) fix buffer pointer use [fuzzing]
Karel Zak [Thu, 2 Jun 2022 14:02:54 +0000 (16:02 +0200)] 
libblkid: (bsd) fix buffer pointer use [fuzzing]

Reported-by: Thibault Guittet <tguittet@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: (mac) make sure block size is large enough [fuzzing]
Karel Zak [Thu, 2 Jun 2022 14:02:54 +0000 (16:02 +0200)] 
libblkid: (mac) make sure block size is large enough [fuzzing]

Reported-by: Thibault Guittet <tguittet@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: (probe) fix size and offset overflows [fuzzing]
Karel Zak [Thu, 2 Jun 2022 14:02:54 +0000 (16:02 +0200)] 
libblkid: (probe) fix size and offset overflows [fuzzing]

Reported-by: Thibault Guittet <tguittet@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: add FSSIZE implementation for btrfs and ext
Andrey Albershteyn [Fri, 27 May 2022 11:57:14 +0000 (13:57 +0200)] 
libblkid: add FSSIZE implementation for btrfs and ext

The implementation does not take into account complete metadata
overhead. The BTRFS one doesn't consider redundant data in RAID
configuration. The ext one doesn't take into account file system
overhead.

Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
2 years agoMerge branch 'fix/xfs-block-size' of https://github.com/alberand/util-linux
Karel Zak [Mon, 30 May 2022 10:07:16 +0000 (12:07 +0200)] 
Merge branch 'fix/xfs-block-size' of https://github.com/alberand/util-linux

* 'fix/xfs-block-size' of https://github.com/alberand/util-linux:
  libblkid: update documentation of BLOCK_SIZE tag
  libblkid: add FSBLOCKSIZE tag

2 years agopipesz: correct manpage issues
Nathan Sharp [Fri, 27 May 2022 02:59:44 +0000 (20:59 -0600)] 
pipesz: correct manpage issues

pipesz's manual page reflects an older version which examined all file
descriptors when --get was specified without --fd or --file.

This patch corrects this, fixes a spelling issue, and makes some
formatting tweaks to improve the clarity of some sections.

Signed-off-by: Nathan Sharp <nwsharp@live.com>
2 years agolibblkid: update documentation of BLOCK_SIZE tag
Andrey Albershteyn [Fri, 27 May 2022 10:56:27 +0000 (12:56 +0200)] 
libblkid: update documentation of BLOCK_SIZE tag

The name BLOCK_SIZE is unfortunate. This tag doesn't represent
commonly used file system block size but minimal block size
accessible by file system (sector size).

Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
2 years agolibblkid: add FSBLOCKSIZE tag
Andrey Albershteyn [Fri, 27 May 2022 10:05:32 +0000 (12:05 +0200)] 
libblkid: add FSBLOCKSIZE tag

The FSBLOCKSIZE tag exposes file system block size in contrast to
the BLOCK_SIZE (unfortunate name) which returns minimal accessible
block size (sector size).

Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
2 years agoAdd pipesz.1.adoc to po4a configuration
Mario Blättermann [Thu, 26 May 2022 13:04:19 +0000 (15:04 +0200)] 
Add pipesz.1.adoc to po4a configuration

2 years agoloopdev: set block_size when using LOOP_CONFIGURE
Hideki EIRAKU [Wed, 25 May 2022 03:23:16 +0000 (12:23 +0900)] 
loopdev: set block_size when using LOOP_CONFIGURE

LOOP_CONFIGURE ioctl was introduced by commit
d5fd456c88aba4fcf77d35fe38024a8d5c814686. Since the previous
implementation set partscan flag but did not set block_size with the
LOOP_CONFIGURE ioctl, an issue fixed by commit
422f0e9f206a145c59a71333dad20d38cbbfc0c4 was reappeared. Setting
block_size in the LOOP_CONFIGURE ioctl parameter fixes the issue.

Signed-off-by: Hideki EIRAKU <hdk@igel.co.jp>
2 years agoMerge branch 'taskset-mistake' of https://github.com/csbo98/util-linux
Karel Zak [Thu, 26 May 2022 07:49:29 +0000 (09:49 +0200)] 
Merge branch 'taskset-mistake' of https://github.com/csbo98/util-linux

* 'taskset-mistake' of https://github.com/csbo98/util-linux:
  Maybe there is a little mistake in do_taskset() function in taskset.c. In the first call of sched_getaffinity(), if the call is failed we should use err_affinity(ts->pid, 0) other than err_affinity(ts->pid, 1).

2 years agoMaybe there is a little mistake in do_taskset() function in taskset.c.
csbo98 [Sun, 22 May 2022 06:47:13 +0000 (14:47 +0800)] 
Maybe there is a little mistake in do_taskset() function in taskset.c.
In the first call of sched_getaffinity(), if the call is failed we should
use err_affinity(ts->pid, 0) other than err_affinity(ts->pid, 1).

2 years agominor: clarity in fstrim.timer
Sebastian Pucilowski [Fri, 20 May 2022 06:47:12 +0000 (16:47 +1000)] 
minor: clarity in fstrim.timer

2 years agopipesz: fix dead code [coverity scan]
Karel Zak [Thu, 19 May 2022 07:48:18 +0000 (09:48 +0200)] 
pipesz: fix dead code [coverity scan]

309                     if (!opt_quiet && n_opt_size > 1)
>>>     CID 378501:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "warnx(dcgettext(NULL, "usin...".
310                             warnx(_("using last specified size"));

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopipesz: fix minor coding style issues
Karel Zak [Wed, 18 May 2022 08:41:00 +0000 (10:41 +0200)] 
pipesz: fix minor coding style issues

* remove tailing white spaces
* use {} for while()
* fix --help indention

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopipesz: add bash-completion script
Nathan Sharp [Tue, 12 Apr 2022 04:59:30 +0000 (22:59 -0600)] 
pipesz: add bash-completion script

Signed-off-by: Nathan Sharp <nwsharp@live.com>
2 years agopipesz: add manpage
Nathan Sharp [Tue, 12 Apr 2022 04:59:29 +0000 (22:59 -0600)] 
pipesz: add manpage

Signed-off-by: Nathan Sharp <nwsharp@live.com>
2 years agopipesz: add tests
Nathan Sharp [Tue, 12 Apr 2022 04:59:28 +0000 (22:59 -0600)] 
pipesz: add tests

Signed-off-by: Nathan Sharp <nwsharp@live.com>
2 years agopipesz: add the pipesz utility
Nathan Sharp [Tue, 12 Apr 2022 04:59:27 +0000 (22:59 -0600)] 
pipesz: add the pipesz utility

pipesz is a utility to examine and adjust the size of pipe buffers.

It uses fctnl F_GETPIPE_SZ and F_SETPIPE_SZ to examine and resize
these buffers. This functionality is unique to Linux and was added in
version 2.6.35. Minor bugfixes were made in 4.9, but these do not
obviate the use of pipesz prior to that release.

Signed-off-by: Nathan Sharp <nwsharp@live.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'issue-1686' of https://github.com/sshambar/util-linux
Karel Zak [Wed, 18 May 2022 07:30:38 +0000 (09:30 +0200)] 
Merge branch 'issue-1686' of https://github.com/sshambar/util-linux

* 'issue-1686' of https://github.com/sshambar/util-linux:
  fstrim: Remove all skipped entries before de-duplication

2 years agoMerge branch 'patch-1' of https://github.com/neheb/util-linux
Karel Zak [Wed, 18 May 2022 07:24:04 +0000 (09:24 +0200)] 
Merge branch 'patch-1' of https://github.com/neheb/util-linux

* 'patch-1' of https://github.com/neheb/util-linux:
  meson: don't build po if no gettext

2 years agoMerge branch '1' of https://github.com/neheb/util-linux
Karel Zak [Wed, 18 May 2022 07:23:48 +0000 (09:23 +0200)] 
Merge branch '1' of https://github.com/neheb/util-linux

* '1' of https://github.com/neheb/util-linux:
  replace prefix with args
  meson: fix tzname check and simplify strsignal

2 years agomeson: don't build po if no gettext
Rosen Penev [Wed, 18 May 2022 00:04:47 +0000 (17:04 -0700)] 
meson: don't build po if no gettext

2 years agoreplace prefix with args
Rosen Penev [Mon, 16 May 2022 03:36:39 +0000 (20:36 -0700)] 
replace prefix with args

meson reference says in case of _GNU_SOURCE that args should be used.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agomeson: fix tzname check and simplify strsignal
Rosen Penev [Mon, 16 May 2022 03:24:21 +0000 (20:24 -0700)] 
meson: fix tzname check and simplify strsignal

The former needs _GNU_SOURCE under musl. The latter can just use
has_function.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agofstrim: Remove all skipped entries before de-duplication
Scott Shambarger [Thu, 12 May 2022 23:27:26 +0000 (16:27 -0700)] 
fstrim: Remove all skipped entries before de-duplication

When processing fstab entries, de-duplication is performed based on the
source before all tests on the target have been checked, resulting in
some entries being skipped when a removed duplicate with a different
target would not have been.

The fix is to move all the target checks before the source
de-duplication.

Addresses: #1686
Signed-off-by: Scott Shambarger <devel@shambarger.net>
2 years agolosetup: Fix typo for the --sector-size docs
Alberto Ruiz [Thu, 12 May 2022 21:35:21 +0000 (23:35 +0200)] 
losetup: Fix typo for the --sector-size docs

2 years agoMerge branch 'hardlink-docs' of https://github.com/ferdnyc/util-linux
Karel Zak [Wed, 11 May 2022 08:21:34 +0000 (10:21 +0200)] 
Merge branch 'hardlink-docs' of https://github.com/ferdnyc/util-linux

* 'hardlink-docs' of https://github.com/ferdnyc/util-linux:
  hardlink: Fix man page docs for '-v/--verbose'
  hardlink: Wrap -b to 80 cols, in --help
  hardlink: Move reflink options in manpage
  hardlink: Move -c option in --help
  hardlink: Document '-c' option in manpage

2 years agofix time_t format
Rosen Penev [Tue, 3 May 2022 00:53:07 +0000 (17:53 -0700)] 
fix time_t format

Use musl's define to test for 64-bit time_t.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agofix various formats
Rosen Penev [Tue, 3 May 2022 00:43:32 +0000 (17:43 -0700)] 
fix various formats

Found with -Wformat.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agohardlink: Fix man page docs for '-v/--verbose'
FeRD (Frank Dana) [Mon, 9 May 2022 21:17:57 +0000 (17:17 -0400)] 
hardlink: Fix man page docs for '-v/--verbose'

Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
2 years agohardlink: Wrap -b to 80 cols, in --help
FeRD (Frank Dana) [Mon, 9 May 2022 21:14:48 +0000 (17:14 -0400)] 
hardlink: Wrap -b to 80 cols, in --help

Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
2 years agohardlink: Move reflink options in manpage
FeRD (Frank Dana) [Mon, 9 May 2022 11:32:44 +0000 (07:32 -0400)] 
hardlink: Move reflink options in manpage

The documentation for the --reflink and --skip-reflink options
felt sort of shoe-horned into the rest of the options, in the
man page. Reorder to match where they appear in the --help output.

Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
2 years agohardlink: Move -c option in --help
FeRD (Frank Dana) [Mon, 9 May 2022 11:31:13 +0000 (07:31 -0400)] 
hardlink: Move -c option in --help

The new placement mirrors its position in the manpage, and
keeps it grouped with the individual flags for which it
acts as a shorthand.

Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
2 years agohardlink: Document '-c' option in manpage
FeRD (Frank Dana) [Mon, 9 May 2022 11:20:26 +0000 (07:20 -0400)] 
hardlink: Document '-c' option in manpage

Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
2 years agofstrim: check for ENOSYS when using --quiet-unsupported
Narthorn [Sat, 7 May 2022 05:43:02 +0000 (07:43 +0200)] 
fstrim: check for ENOSYS when using --quiet-unsupported

Some filesystems like bindfs report ENOSYS (Function not implemented)
for the trim ioctl, which should be caught by --quiet-unsupported.

2 years agoMerge branch 'meson-fixups' of https://github.com/eli-schwartz/util-linux
Karel Zak [Thu, 5 May 2022 09:12:23 +0000 (11:12 +0200)] 
Merge branch 'meson-fixups' of https://github.com/eli-schwartz/util-linux

* 'meson-fixups' of https://github.com/eli-schwartz/util-linux:
  meson: fix error in processing version for pc files
  meson: get the project version from the version-gen script

2 years agoMerge branch 'master' of https://github.com/mariobl/util-linux
Karel Zak [Thu, 5 May 2022 09:10:46 +0000 (11:10 +0200)] 
Merge branch 'master' of https://github.com/mariobl/util-linux

* 'master' of https://github.com/mariobl/util-linux:
  Add blkpr.8.adoc to po4a configuration

2 years agoMerge branch 'master' of https://github.com/jlinton/util-linux
Karel Zak [Thu, 5 May 2022 09:09:05 +0000 (11:09 +0200)] 
Merge branch 'master' of https://github.com/jlinton/util-linux

* 'master' of https://github.com/jlinton/util-linux:
  lscpu: Add Snapdragon parts

2 years agomeson: fix error in processing version for pc files
Eli Schwartz [Thu, 5 May 2022 04:16:15 +0000 (00:16 -0400)] 
meson: fix error in processing version for pc files

This awk command was copied verbatim from configure.ac, which included
non-awk syntax because configure.ac cannot contain [ literals.

Rewrite these autoconf quadrigraphs as their actual values, for meson.

Fixes always setting the micro version to "0".

2 years agomeson: get the project version from the version-gen script
Eli Schwartz [Thu, 5 May 2022 03:52:31 +0000 (23:52 -0400)] 
meson: get the project version from the version-gen script

This matches autotools and ensures that the version number is actually
reliable.

2 years agoAdd blkpr.8.adoc to po4a configuration
Mario Blättermann [Wed, 4 May 2022 18:27:24 +0000 (20:27 +0200)] 
Add blkpr.8.adoc to po4a configuration

2 years agolscpu: Add Snapdragon parts
Jeremy Linton [Wed, 4 May 2022 17:30:34 +0000 (12:30 -0500)] 
lscpu: Add Snapdragon parts

QC updated the kernel cputype.h to include the Kyro 4xx and 3xx Silver
part numbers's. Lets sync that commit and naming.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2 years agolibblkid: merge FS* flags into one FSINFO
Andrey Albershteyn [Mon, 2 May 2022 15:08:33 +0000 (17:08 +0200)] 
libblkid: merge FS* flags into one FSINFO

Put BLOCK_SIZE, FSSIZE and FSLASTBLOCK tags under one FSINFO flag.
These, and probably future ones, are read directly from the
superblock (with minor post-processing). These properties are
combined under one flag to escape adding a flag per superblock
member.

Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>