summaryrefslogtreecommitdiffstats
path: root/sys-utils
Commit message (Collapse)AuthorAgeFilesLines
* ipcs: check return value when read from /proc [coverity scan]Karel Zak2019-05-231-3/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: don't use uninitialized value [coverity scan]Karel Zak2019-05-231-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: make posix_fadvise() use more readable for analyzersKarel Zak2019-05-231-2/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: make strtok() use more robustKarel Zak2019-05-231-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: remove never read valueKarel Zak2019-05-231-3/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* zramctl: use xstrncpy()Karel Zak2019-05-201-4/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch '2019wk19' of https://github.com/kerolasa/util-linuxKarel Zak2019-05-201-8/+12
|\ | | | | | | | | | | | | | | | | | | | | * '2019wk19' of https://github.com/kerolasa/util-linux: lib/colors: remove redundant if statement wipefs: fix variable / function shadowing [cppcheck] sulogin: fix variable / function shadowing [cppcheck] lscpu: remove redundant condition check [cppcheck] libmount: avoid possible null pointer dereference [cppcheck] lib/mangle: fix possible null pointer dereference [cppcheck] sfdisk: remove unnecessary size check [cppcheck]
| * lscpu: remove redundant condition check [cppcheck]Sami Kerola2019-05-181-8/+12
| | | | | | | | | | | | | | | | | | [sys-utils/lscpu.c:1783] -> [sys-utils/lscpu.c:1785]: (warning) Either the condition 'desc' is redundant or there is possible null pointer dereference: desc. [sys-utils/lscpu.c:1840] -> [sys-utils/lscpu.c:1842]: (warning) Either the condition 'desc' is redundant or there is possible null pointer dereference: desc. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | Merge branch 'lscpu_midr_updates' of https://github.com/jlinton/util-linuxKarel Zak2019-05-201-0/+3
|\ \ | | | | | | | | | | | | * 'lscpu_midr_updates' of https://github.com/jlinton/util-linux: lscpu: Add additional aarch64 models
| * | lscpu: Add additional aarch64 modelsJeremy Linton2019-05-161-0/+3
| |/ | | | | | | | | | | | | | | ARM has released docs for Cortex-A76, Neoverse-N1 and Neoverse-E1. That means we know the midr partnums, so we can add them to the human readable model name table. Signed-off-by: Jeremy Linton <lintonrjeremy@gmail.com>
* | lscpu: fix floating point exceptionSami Kerola2019-05-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | As the title tells this change indeed fixes floating point exception, but post processing as value overwrite feels a wrong. Possibly something in input is making cpu set count to go wrong, but I could not get my head around what could it be. Anyway avoiding division by zero seems better than crashing so lets do this atleast for now. Caused-by: e5f721132ec8b8c933a396d8dcb3efcb67854f13 Addresses: https://github.com/karelzak/util-linux/issues/788 Reported-by: Lars Wendler <polynomial-c@gentoo.org> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | lscpu: remove extra space from field key nameSami Kerola2019-05-161-3/+3
|/ | | | | | | | | | | | | | | | | | | The extra space was more obvious in json output. But as the expected test output displays also the standard output can be effected by this change. $ lscpu --json | jq '.lscpu | .[].field' | grep ': ' "L1d cache: " "L1i cache: " "L2 cache: " "L3 cache: " "Vulnerability L1tf: " "Vulnerability Mds: " "Vulnerability Meltdown: " "Vulnerability Spec store bypass: " "Vulnerability Spectre v1: " "Vulnerability Spectre v2: " Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* rtcwake: fix "maybe be" duplicationAustin English2019-05-151-2/+2
| | | | Signed-off-by: Austin English <austinenglish@gmail.com>
* mount: fix "maybe be" duplicationAustin English2019-05-151-4/+4
| | | | Signed-off-by: Austin English <austinenglish@gmail.com>
* fstrim: affect only warnings by --quietKarel Zak2019-05-091-6/+7
| | | | | | | | We need the same return code from fstrim_filesystem() independently on --quiet command line option. Addresses: https://github.com/karelzak/util-linux/pull/791 Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: add --quiet option to suppress error messagesSami Kerola2019-05-073-6/+31
| | | | | | | | | | | | | When fstrim interacts with NTFS it result can be error reporting bad file descriptor. That seems to be a bug in NTFS. While waiting driver to get on top of the issue and be commonly available lets add to fstrim option to make it be more silent about errno 9 aka EBADF, Bad file descriptor. Reported-by: https://github.com/moviuro Proposed-by: Dave Reisner <dreisner@archlinux.org> Reference: https://bugs.archlinux.org/task/62288 Addresses: https://github.com/karelzak/util-linux/issues/789 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* losetup: man page has repeating words [make checkmans]Karel Zak2019-04-241-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: document kernel return minlen explicitlyWang Shilong2019-04-241-4/+5
| | | | | | | | | | Filesystem will modify @minlen according to its block size etc, and will return actual unit to userspace, document it into manpage. Cc: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Wang Shilong <wshilong@ddn.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-1642-209/+186Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/c: add print_version() macroKarel Zak2019-04-162-4/+4
| | | | | | | | | | | 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>
* chcpu: fix memory leakKarel Zak2019-04-161-4/+5
| | | | | | The CPU set has been allocated more than once. Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: get realpath before trim ioctlWang Shilong2019-04-151-2/+9
| | | | | | | | | | | | | | | | | | | | | | 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>
* lscpu: wrap default output long lines on terminalKarel Zak2019-04-112-2/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: report CPU vulnerabilitiesKarel Zak2019-04-112-0/+80
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add new e2k subarchesAndrew Savchenko2019-04-091-0/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim.c: Remove commnet about vfat not supporting fstrimMarcos Paulo de Souza2019-04-011-1/+1
| | | | | | | 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>
* lscpu: (man) tiny changesKarel Zak2019-03-191-2/+2
|
* lscpu: fix excl[] array orderKarel Zak2019-03-191-1/+1
| | | | | | It (rows and columns) must be in ASCII order. Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fix and document --output-allKarel Zak2019-03-191-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: define libsmartcols flags for -eKarel Zak2019-03-191-10/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fix --caches orderKarel Zak2019-03-191-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: (man) make SYNOPSIS compatible with another utilsKarel Zak2019-03-191-4/+1Star
| | | | | | In this case is really no reason to duplicate all options in SYNOPSIS. Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: add --bytesKarel Zak2019-03-192-10/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: add --cachesKarel Zak2019-03-193-38/+231
| | | | | | | | | | | | | | | $ 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>
* lscpu: rename macros and functionsKarel Zak2019-03-191-77/+77
| | | | | | | 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>
* lscpu: report more usable cache sizesKarel Zak2019-03-191-2/+41
| | | | | | | | | | | | | | | | | 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>
* lscpu: add 'Frequency boost'Karel Zak2019-03-152-0/+8
| | | | | | | | 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>
* swapon.8: mention btrfs(5)Marcos Mello2019-03-111-15/+14Star
| | | | | | See: https://github.com/kdave/btrfs-progs/commit/5c880c82c2044b0abae5c838c733a2e6522ed122
* Update mount.8MeggyCal2019-03-071-1/+1
| | | xfs is widely supported today
* lscpu: document --hex output regression (since v2.30)Karel Zak2019-02-201-2/+3
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/744 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: fix typos [codespell]Sami Kerola2019-02-181-1/+1
| | | | | Reference: https://github.com/codespell-project/codespell Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* various: fix 'uninitialized when used' warnings [clang]Sami Kerola2019-02-183-3/+3
| | | | | | | This change fixes "warning: variable 'var' may be uninitialized when used here [-Wconditional-uninitialized]" warnings reported in various files. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mount: Do not call mnt_pretty_path() on net file systems.Stanislav Brabec2019-02-061-1/+1
| | | | | | | | | | | | Calling mnt_pretty_path() on network file systems can cause mangling of the output: root# mount | grep nfs nfs.example.com:/home on /home type nfs4 ... root# mkdir -p nfs.example.com:/home root# mount | grep nfs /root/nfs.example.com:/home on /home type nfs4 ... Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* mount.8: clarify (no)suid behavior on file capabilitiesPeter Wu2019-02-011-4/+4
| | | | | | | | | | Clarify that the nosuid option also affects file capabilities and that it only limits execution of programs. (setgid on directories still inherit the group regardless of the nosuid option.) The new text is taken from the mount(2) manual page from the man-pages project. Addresses: https://github.com/karelzak/util-linux/issues/482 Signed-off-by: Peter Wu <peter@lekensteyn.nl>
* setarch: don't return address of automatic variableAndreas Schwab2019-01-221-1/+1
| | | | | | | | | | | On architectures without special personalities setarch uses the contents of a local variable with automatic storage duration after return from the function, causing it to report a spurious error. $ setarch m68k setarch: Kernel cannot set architecture to m68k Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
* losetup: update an error messageJeffrey Ferreira2019-01-221-1/+1
| | | | | | | | Update an error message to add --partscan to the list of options only allowed during loop device setup. Signed-off-by: Jeffrey Ferreira <jeffpferreira@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: properly use --sector-size when create a new deviceKarel Zak2019-01-222-18/+22
| | | | | | | | | | | | | The --partscan functionality depends on sector size. Make sure sector size is set before we force kernel to scan the device for partitions. For example: losetup -f loopfile --sector-size 4KiB --partscan --show where 'loopfile' contains GPT with 4096 sectors. Reported-by: Jeffrey Ferreira <jeffpferreira@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/loopdev: differentiate between setter()s and ioctl callsKarel Zak2019-01-221-4/+4
| | | | | | | | Now the internal API uses loopcxt_set_...() to set context variables as well as to call ioctls. This patch introduces loopcxt_ioctl_...() to makes things more obvious to readers. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: be more explicit about BTRFSKarel Zak2019-01-221-3/+4
| | | | | | | | It seems nocow and nodatasum attributes are required. See btrfs_swap_activate() in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ed46ff3d423780fa5173b38a844bf0fdb210a2a7 Addresses: https://github.com/karelzak/util-linux/issues/633 Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: rewrite section about swapfilesKarel Zak2019-01-221-24/+21Star
| | | | | | | | | | | | * don't duplicate info on two places -- let's keep only small note in mkswap(8) man page, suggest to read swapon(8) man page * add info about kernel versions for XFS and Btrfs swapfiles support * use subsection in the NOTES Addresses: https://github.com/karelzak/util-linux/issues/633 Signed-off-by: Karel Zak <kzak@redhat.com>