summaryrefslogtreecommitdiffstats
path: root/sys-utils
Commit message (Collapse)AuthorAgeFilesLines
* umount: add note about FS names differences to the man pageKarel Zak2016-04-151-0/+6
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1327209 Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove obsolete commentKarel Zak2016-04-131-4/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: make static analyzer happy [clang analyze]Karel Zak2016-03-291-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'tests-setarch' of https://github.com/rudimeier/util-linuxKarel Zak2016-03-241-2/+5
|\ | | | | | | | | | | | | * 'tests-setarch' of https://github.com/rudimeier/util-linux: tests: improve setarch tests, regarding --uname-2.6 issues setarch: add "exec" message to --verbose build-sys: ignore vim .swp files
| * setarch: add "exec" message to --verboseRuediger Meier2016-03-221-2/+5
| | | | | | | | | | | | Also we don't need fflush() in non-verbose case. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | lsipc: don't free shm data if no shm id is foundRomain Naour2016-03-231-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | There is a segfault in do_shm_global() when ipc_shm_get_info() return 0 and ipc_shm_free_info() is called. When no shm id is found, the memory allocated in shmds by ipc_shm_get_info() is already free when ipc_shm_free_info() is called. Move ipc_shm_free_info(shmds) inside the if statement where at least one shm id is found. Signed-off-by: Romain Naour <romain.naour@gmail.com>
* | lscpu: revert unnecessary path_exist()Karel Zak2016-03-221-1/+1
| | | | | | | | | | | | | | The features file is there from 2.6.31 when Xen has been added to kernel. Sorry. Signed-off-by: Karel Zak <kzak@redhat.com>
* | lscpu: correct the Virtualization type on Xen DomU PV guestDongli Zhang2016-03-221-2/+30
|/ | | | | | | | | | | | | | | | | | | | | | | Nowadays, most Intel CPUs have "cpuid faulting" available which could trap the execution of "cpuid" instruction when CPL>0 with GP fault. Thus, "cpuid" instruction could trap to Xen hypervisor on the paravirtualized PV guest on most servers today, except on old CPUs prior to 2011. On CPU after 2011, Xen will put "XenVMMXenVMM" on both HVM and PV guests, which could have lscpu command erroneously classify the guest as type "full". The current lscpu command, which is based on "cpuid" instruction, still assumes that it will not cause the trap to Xen hypervisor on Xen PV guest and uses /proc/xen to identify whether it's running on PV DomU or not. To identify this kind of information under the help of /sys/hypervisor/properties/features would be more accurate for the CPU nowadays. The bit 5 (XENFEAT_mmu_pt_update_preserve_ad) of the features will be set only when it's running on Xen PV domain. The combo of bit 3 and 8 (XENFEAT_supervisor_mode_kernel and XENFEAT_hvm_callback_vector) will be set simultaneously only when it's running on Xen PVH domain. [kzak@redhat.com: - add path_exist()] Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch '2016-03-02/cgns' of https://github.com/hallyn/util-linuxKarel Zak2016-03-214-20/+60
|\ | | | | | | | | * '2016-03-02/cgns' of https://github.com/hallyn/util-linux: Implement support for cgroup namespaces
| * Implement support for cgroup namespacesSerge Hallyn2016-03-034-20/+60
| | | | | | | | | | | | Currently these are supported in #for-next. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
* | ipcs: consolidate output header printingRuediger Meier2016-03-211-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Print a warning (instead of header) if --limits fails, like we did it in past (2.20.1) and like we are still doing for --summary. Note in past we were printing the same message like for --summary "kernel not configured for ...", but actually this message is not really correct. This patch simply consolidates the current behavior. Probably we should refactor it regarding warnings (stderr) and exit codes. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | ipcs: --shmems, upward/backward compatibilityRuediger Meier2016-03-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Re-add backward compatibility which got lost in 058e8154. Initializing unknown struct members to 0xdead is similar to the fallback. For upward compatibility ignore columns > 16 but not the whole line (in case the kernel would add more columns in future). Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | ipcs: make sure to parse whole lines for shm_dataRuediger Meier2016-03-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | We want to parse 16 columns _per_row_ without mixing them up. The existing code is unsafe for more or less columns and could even run into endless loops. This patch assures that we parse row-wise and really skip lines with columns != 16. Probably somehow we could have also done this with fscanf() only. Using fgets() additionally makes the code more easy to read and to improve later. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | swapon: rewrite control struct usageKarel Zak2016-03-182-118/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old version has been pretty broken... the most important is to keep swap options specified on command line as read-only template. For example if we call "swapon --all" then we cannot modify the global options for each fstab swap entry. The another story has been control struct modification due to device reinitialization etc. This patch splits all to: * struct swapon_control; top-level struct with command line options * struct swap_device; this is device specific and never globally maintained by swapon_control. * struct swap_prop; used as global read-only template swap options and per device swap options (when parse fstab). Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818252 Signed-off-by: Karel Zak <kzak@redhat.com>
* | umount: add man page note that --force is not perfectKarel Zak2016-03-171-0/+4
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | docs: miscellaneous tiny tweaks of man pagesBenno Schulenberg2016-03-172-9/+7Star
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | unshare: describe the setgroups restriction more explicitlyBenno Schulenberg2016-03-171-10/+15
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | lscpu: improve spacing and spelling in the man pageBenno Schulenberg2016-03-171-12/+12
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | lscpu: fix memleak because of ambiguous tagsRuediger Meier2016-03-161-1/+2
| | | | | | | | | | | | | | Now the first one of certain ambiguous tags wins. Alternatively to this patch we could have called free() before xstrdup(). Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | lscpu: use cpu and revision tag if availableRuediger Meier2016-03-161-9/+8Star
| | | | | | | | | | | | | | | | | | | | Avoid ifdef which does not work with --sysroot. Our existing test dumps produce even better output now for ppc and sparc. The logic moved to the printing section. CC: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | Revert "lscpu: keep lscpu usable on snapshots"Ruediger Meier2016-03-161-18/+7Star
| | | | | | | | | | | | This reverts commit 641350fe822e7f1ac10873dad9a364bdeaba8083. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | dmesg: improve grammar and consistency of usage textBenno Schulenberg2016-03-161-3/+3
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | mount, umount, swapon, fsck, lsblk, findmnt: harmonize six error messagesBenno Schulenberg2016-03-163-6/+3Star
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | lscpu: keep lscpu usable on snapshotsKarel Zak2016-03-151-7/+18
| | | | | | | | | | | | | | | | | | | | This patch reverts 3ac03fe4d20558b55635a048d7f2fb0f5e85ee2a for snapshots (--sysroot). Yeah, poor-man solution. It would be really nice to have runtime detection to support model overwriting also on snapshots. Signed-off-by: Karel Zak <kzak@redhat.com>
* | swapon: remove unnecessary assertKarel Zak2016-03-151-3/+0Star
| | | | | | | | | | Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818252 Signed-off-by: Karel Zak <kzak@redhat.com>
* | lscpu: Fix model and model name on Power SystemsVasant Hegde2016-03-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Power System, lspcu presently displays system model number instead of processor model name. 'model' tag in cpuinfo contains system model name, not processor model. Instead it uses 'cpu' tag for processor model name. Also it uses 'revision' tag for processor model. Fix lspcu so that it displays processor model number. Also display processor model name. cpuinfo output on Power System: ... ... processor : 127 cpu : POWER8E (raw), altivec supported clock : 4322.000000MHz revision : 2.1 (pvr 004b 0201) timebase : 512000000 platform : PowerNV model : 8286-42A machine : PowerNV 8286-42A firmware : OPAL Output without this patch: Architecture: ppc64le Byte Order: Little Endian CPU(s): 128 On-line CPU(s) list: 0-127 Thread(s) per core: 8 Core(s) per socket: 4 Socket(s): 4 NUMA node(s): 4 Model: 8286-42A ... ... Output with this patch: Architecture: ppc64le Byte Order: Little Endian CPU(s): 128 On-line CPU(s) list: 0-127 Thread(s) per core: 8 Core(s) per socket: 4 Socket(s): 4 NUMA node(s): 4 Model: 2.1 (pvr 004b 0201) Model name: POWER8E (raw), altivec supported ... ... Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
* | unshare: tiny changeKarel Zak2016-03-141-1/+1
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | unshare: fix incomplete sentence in man pageKarel Zak2016-03-141-1/+1
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | unshare: improve wording and formatting in the man pageBenno Schulenberg2016-03-141-58/+59
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | unshare: replace a special character in the man page with a spaceBenno Schulenberg2016-03-141-1/+1
| | | | | | | | | | Reported-by: Andreas Henriksson <andreas@fatal.se> Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | fallocate: improve synopsis and spelling in man pageBenno Schulenberg2016-03-141-6/+4Star
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | fallocate: restore man-page content that was deleted in commit 5b033bfdBenno Schulenberg2016-03-141-0/+120
| | | | | | | | | | Reported-by: Andreas Henriksson <andreas@fatal.se> Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | Merge branch 'travis-osx' of https://github.com/rudimeier/util-linuxKarel Zak2016-03-142-4/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'travis-osx' of https://github.com/rudimeier/util-linux: travis: add OSX build travis: switch to Ubuntu 14.04 Trusty build-sys: improve uuidd and script build conditions build-sys: use AC_PROG_MKDIR_P and remove a few gnuisms build-sys: add missing "not found" strings build-sys: fix again UL_SCANF_TYPE_MODIFIER tests: don't use system's mount commands tests: improve skipping of old btrfs-tools tests: remove invalid argument in libmount/debug tests: skip old socat silently misc: fix icc/clang compiler warnings misc: fix printf i386 compiler warnings
| * | build-sys: use AC_PROG_MKDIR_P and remove a few gnuismsRuediger Meier2016-03-131-1/+1
| | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | misc: fix printf i386 compiler warningsRuediger Meier2016-03-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Still a few printf warnings found on i386 Linux: libfdisk/src/alignment.c: In function 'fdisk_align_lba': libfdisk/src/alignment.c:115:3: warning: format '%ju' expects argument of type 'uintmax_t', but argument 6 has type 'long unsigned int' [-Wformat] sys-utils/lsns.c: In function ‘add_namespace’: sys-utils/lsns.c:346:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘ino_t’ [-Wformat] sys-utils/lsns.c: In function ‘add_process_to_namespace’: sys-utils/lsns.c:362:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘ino_t’ [-Wformat] sys-utils/lsns.c: In function ‘add_scols_line’: sys-utils/lsns.c:440:4: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘ino_t’ [-Wformat] Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | | setsid: fix argument count bugSami Kerola2016-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The below demonstrates what happen before this change. $ setsid --wait setsid: child 3252 did not exit normally: Success Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | | swapon: fix discard=pages docsRichard Yao2016-03-141-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for discard=pages is ambiguous in that it could be interpreted to mean either that the pages are discarded immediately after being freed or that the pages are discarded immediately before being reused by a write. Both implementations would satisfy the statement "discard freed swap pages before they are avaliable for reuse", but the kernel does the former. Doing a discard operation (which is non-queued on SATA drives before SATA 3.1) before a write operation to the same sector is pointless unless using, pre-SATA 3.1 drives, where discard is detrimental because ATA TRIM is a non-queued command. Anyone who wants discard operations on swap and interprets the man page as describing the incorrect behavior would opt for discard=once over discard, when discard provides the behavior of both discard=once and discard=pages, which is what they likely want. Lets make a small change to the documentation to clarify the behavior. Signed-off-by: Richard Yao <ryao@gentoo.org>
* | blkdiscard: slice up the recently changed usage textBenno Schulenberg2016-03-091-7/+8
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | mount: further improve formatting of the man pageBenno Schulenberg2016-03-091-125/+118Star
| | | | | | | | | | | | | | | | | | Mainly by using proper subsections (so they can be indexed), protecting some things from hyphenation, and marking with \& periods that don't end sentences. Tweaking some wordings too. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* | Revert "include sysmacros.h where used"Karel Zak2016-03-082-2/+0Star
| | | | | | | | This reverts commit 46a40c018438b7b2b25083a5e5a4a21055a0c1e9.
* | mount: adjust some wordings and formatting in the man pageBenno Schulenberg2016-03-081-29/+20Star
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | ctrlaltdel: tweak the wording in the man pageBenno Schulenberg2016-03-081-4/+5
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | losetup: correct some formatting in the man pageBenno Schulenberg2016-03-081-6/+8
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | mount: hardwrap an overlong example in the man pageBenno Schulenberg2016-03-081-1/+4
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | fstrim: a few tiny tweaks of the man pageBenno Schulenberg2016-03-081-5/+5
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | include sysmacros.h where usedMike Frysinger2016-03-082-0/+2
| | | | | | | | | | | | | | | | BSD/Linux systems stick major/minor/makedev in sysmacros.h. Newer Linux libraries have been moving away from including sysmacros.h implicitly via sys/types.h, so include it directly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | misc: never cast void* from malloc(3) and friendsRuediger Meier2016-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | Such cast could hide serious compiler warnings in case we are missing includes (e.g. <stdlib.h> or "xalloc.h"). See http://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | misc: safer (and uniform) handling of return valueYuriy M. Kaminskiy2016-03-072-3/+7
| | | | | | | | | | | | When `rc` is `INT_MAX`, `rc + 1` result in signed integer overflow. Signed-off-by: Karel Zak <kzak@redhat.com>
* | lsns.c: fix error returnYuriy M. Kaminskiy2016-03-071-1/+1
| | | | | | | | | | | | | | If non-negative value returned, errno could be unset (especially 0). Signed-off-by: Karel Zak <kzak@redhat.com>
* | lscpu: fix backward buffer size adjustment after adding delimiterYuriy M. Kaminskiy2016-03-071-2/+2
| | | | | | | | | | | | | | remaining buffer space was increased after adding character, instead of decreasing Signed-off-by: Karel Zak <kzak@redhat.com>