Commit Graph

13309 Commits

Author SHA1 Message Date
Karel Zak 2da48ba3cc tests: use TS_ENABLE_ASAN in tests to detect ASAN
It seems better to not use any random ASAN variable.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-17 10:10:46 +02:00
Karel Zak 2c308875a7 misc: consolidate version printing and close_stdout()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-16 15:14:13 +02:00
Karel Zak 68224d108d include/c: add print_version() macro
Let's consolidate the version printing code. It also seems better to
use exit() after --version, because it's handled in different way by
ASAN.

It's strange, but ASAN reports leaks after return in main(). Note that
we do not use free-before-exit.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-16 13:47:17 +02:00
Karel Zak 31c66833cb include/closestream: add close_stdout_atexit()
It seems better to have a way to control when atexit(close_stdout()) is
used, because close stdout means that for example ASAN (or another
into binary integrated tool) is not able to print the final summary.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-16 13:42:34 +02:00
Karel Zak 7f8787d094 chcpu: fix memory leak
The CPU set has been allocated more than once.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-16 10:51:35 +02:00
Karel Zak 2e5ff9db30 libmount: fix compiler warning [-Wsometimes-uninitialized]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-15 13:35:21 +02:00
Karel Zak 7bd44e8ade build-sys: enable ASAN on travis-ci
Addresses: Addresses: https://github.com/systemd/systemd/pull/12252
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-15 13:05:33 +02:00
Karel Zak ef61c093d3 build-sys: add ASAN_LDFLAGS
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-15 13:01:21 +02:00
Karel Zak 1271e63c49 tests: ignore errors with enabled ASAN in python bindings
temporary solution... as it ends with
	undefined symbol: __asan_option_detect_stack_use_after_return

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-15 12:58:48 +02:00
Karel Zak 82e39473a5 libmount: fix memleak on parse errors
Addresses: https://github.com/systemd/systemd/pull/12252
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-15 12:55:46 +02:00
Wang Shilong 8302b2009a fstrim: get realpath before trim ioctl
Original motivation is we want to run fstrim command
on Lustre[1] osd server mount point directly, however
our server mount point doesn't export osd directory
to users, and it will cause following command fail:

 $fstrim -v /mnt/mds/

But following succeed:

 $fstrim -v /mnt/mds

We could improve this a bit by getting realpath
before trapping kernel, this also give benifits
to normal use cases.

Cc: Andreas Dilger <adilger@dilger.ca>
Cc: Shuichi Ihara <sihara@ddn.com>
[1] http://wiki.lustre.org/Main_Page
Signed-off-by: Wang Shilong <wshilong@ddn.com>
2019-04-15 11:12:55 +02:00
Karel Zak 8b2464ae2a tests: update lscpu due to 'Vulnerability' fields
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-11 13:55:51 +02:00
Karel Zak b8910af5a6 lscpu: wrap default output long lines on terminal
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-11 13:53:03 +02:00
Karel Zak 639eeb28dd lscpu: report CPU vulnerabilities
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-11 13:45:29 +02:00
Karel Zak 3c4ff2dc9d include/strutils: add functions to replace and remove chars from string
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-11 13:13:06 +02:00
Karel Zak 7761bd3bb6 lib/fileutils: add xreaddir()
Remove duplicate code and keep only one implementation in
include/fileutils.h.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-11 13:11:53 +02:00
Andrew Savchenko 146900d411 setarch: add new e2k subarches
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-09 11:04:17 +02:00
Karel Zak 5b13d6a1c9 tests: add /mnt/test/foo^Mbar to mountinfo tests
Addresses: https://github.com/karelzak/util-linux/issues/780
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-08 15:22:27 +02:00
Karel Zak 6c9ab254ae libmount: don't use sscanf() for swaps parsing
Addresses: https://github.com/karelzak/util-linux/issues/780
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-08 15:16:23 +02:00
Karel Zak 86673b3a46 libmount: don't use sscanf() for mountinfo parsing
Addresses: https://github.com/karelzak/util-linux/issues/780
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-08 14:45:56 +02:00
Karel Zak 36fcefa651 libmount: don't use sscanf() for fstab parsing
Addresses: https://github.com/karelzak/util-linux/issues/780
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-08 13:34:47 +02:00
Karel Zak f1428af5be Merge branch 'spelling' of https://github.com/jwilk-forks/util-linux
* 'spelling' of https://github.com/jwilk-forks/util-linux:
  docs: fix typo
2019-04-02 12:05:25 +02:00
Marcos Paulo de Souza e108643981 fstrim.c: Remove commnet about vfat not supporting fstrim
Commit f663b5b38f ("fat: add FITRIM ioctl for FAT file system") in
linux kernel added support for using fstrim with vfat filesystem.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2019-04-01 18:38:31 -03:00
Karel Zak c313ee737b tastset: (man) add :N stride for CPU lists
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-29 13:00:42 +01:00
Karel Zak 4534e4f2fb fsck: (man) labels are available for all filesystems
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-28 15:29:09 +01:00
Karel Zak 99c1ebee21 su: change error message
We use PAM and if pam_strerror() returns nothing we have no clue why
authentication failed. It's mistake to blame incorrect password if
there are many possible reason...

Addresses: https://github.com/karelzak/util-linux/issues/778
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-25 16:39:43 +01:00
Jakub Wilk 25d9f1403d docs: fix typo
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2019-03-22 13:27:33 +01:00
Karel Zak 65bcbf105b taskset: fix cpuset list parser
taskset hangs when executed with badly formatted cpuset list, for
example:

	 $ taskset -c 0--1 true

The current cpuset list parser is pretty weak as based on scanf()
without strings verification ("-1" as input for "%u" returns
unexpected number). It seems faster and better to use strtoul() and
isdigit().

Addresses: https://github.com/karelzak/util-linux/issues/77
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-20 13:12:25 +01:00
Karel Zak 06c141a99a lscpu: (man) tiny changes 2019-03-19 17:00:01 +01:00
Karel Zak a44cd89128 lscpu: fix excl[] array order
It (rows and columns) must be in ASCII order.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 16:56:28 +01:00
Karel Zak 0a31a242cb lscpu: fix and document --output-all
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 16:47:55 +01:00
Karel Zak 2ec00a10b2 lscpu: define libsmartcols flags for -e
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 16:40:51 +01:00
Karel Zak 4161da7bb0 lscpu: fix --caches order
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 16:24:54 +01:00
Karel Zak 9261d0a119 lscpu: (man) make SYNOPSIS compatible with another utils
In this case is really no reason to duplicate all options in SYNOPSIS.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 14:30:09 +01:00
Karel Zak 2011528bce lscpu: add --bytes
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 14:29:40 +01:00
Karel Zak 0e86bc8406 lscpu: add --caches
$ lscpu -C
NAME ONE-SIZE ALL-SIZE WAYS TYPE        LEVEL
L3         8M       8M   16 Unified         3
L2       256K       1M    8 Unified         2
L1i       32K     128K    8 Instruction     1
L1d       32K     128K    8 Data            1

The patch also updates extra caches (s390) output in lsblk summary to
be compatible with output about normal caches.

Addresses: https://github.com/karelzak/util-linux/issues/663
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 14:11:20 +01:00
Karel Zak 357dd756d1 lib/path: remove extra semi-colons
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 13:57:05 +01:00
Karel Zak cc07239d5c lscpu: rename macros and functions
We need to differentiate between output about CPUs and another stuff
(caches in future). Let's make it more obvious in code.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 13:57:05 +01:00
Karel Zak 1b4b184cc8 tests: update lscpu output
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 13:56:26 +01:00
Karel Zak e5f721132e lscpu: report more usable cache sizes
The current version reports cache size as reported by /sys, it means
real size of the one piece of the cache. This way provides minimal
overview about all system as the cache is often shared between CPUs.

It seems better to report all size of the caches in the summary
output. It also does not make sense to report sizes per core (or
socket) as CPU topology may be pretty complicated.

The final solution (not implemented yet) will be to have --list-caches
where we can report all details like all-size, item-size, per-core size,
ways, type, etc.

Addresses: https://github.com/karelzak/util-linux/issues/663
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-19 11:09:02 +01:00
Karel Zak fb3761809f lsblk: force tree on --json --tree independently on used columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-18 16:58:41 +01:00
Karel Zak 58bfb7e927 docs: TODO lscpu --list-caches
Addresses: https://github.com/karelzak/util-linux/issues/663
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-18 14:14:09 +01:00
Karel Zak 16ca05511b lscpu: add 'Frequency boost'
Show turbo boost status on platforms where is available a file
/sys/devices/system/cpu/cpufreq/boost.

Addresses: https://github.com/karelzak/util-linux/issues/755
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-15 13:37:51 +01:00
Karel Zak a8f103f079 Merge branch 'swapon-btrfs' of https://github.com/marcosfrm/util-linux
* 'swapon-btrfs' of https://github.com/marcosfrm/util-linux:
  swapon.8: mention btrfs(5)
2019-03-11 12:09:30 +01:00
Karel Zak 9bfff042d0 Merge branch 'setterm' of https://github.com/jwilk-forks/util-linux
* 'setterm' of https://github.com/jwilk-forks/util-linux:
  setterm: fix --hbcolor description
2019-03-11 12:06:38 +01:00
Karel Zak 5bf5752e28 blkid: (man) cleanup return code section
Addresses: https://github.com/karelzak/util-linux/issues/764
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-11 12:02:31 +01:00
Marcos Mello 63391d7579 swapon.8: mention btrfs(5)
See:

5c880c82c2
2019-03-11 07:30:35 -03:00
Jakub Wilk f28985ffc3 setterm: fix --hbcolor description
--hbcolor is for half-bright characters, which is sort of opposite of
bold.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2019-03-08 21:27:59 +01:00
Karel Zak ffe147fadd Merge branch 'setterm' of https://github.com/jwilk-forks/util-linux
* 'setterm' of https://github.com/jwilk-forks/util-linux:
  setterm: update comments about -ulcolor/-hbcolor syntax
  setterm: fix bright colors for --ulcolor/--hbcolor
  setterm: disallow "default" for --ulcolor/--hbcolor
2019-03-08 13:15:29 +01:00
Karel Zak 9847106585 Merge branch 'patch-2' of https://github.com/MeggyCal/util-linux
* 'patch-2' of https://github.com/MeggyCal/util-linux:
  Update mount.8
2019-03-08 12:33:10 +01:00