\- changed to - (code "hyphen-minus", rendered with the glyph hyphen
in troff) if it is a part of a compound name. A minus is not used in
words. People using UTF-8 and copy-and-pase can(?) (may?) use "info",
"man --ascii" or the command "man" should have an option to display the
- in names of options with the code (character name) "hyphen-minus"
(u002D) instead of "u2010" (code (character) name "hyphen")
Karel Zak [Mon, 7 Apr 2014 09:53:05 +0000 (11:53 +0200)]
mount: fix --all and nofail return code
Now the "nofail" affects warnings warning messages only. That's wrong
and regression (against original non-libmount version). The nofail has
to control return code too.
Reported-by: Patrick McLean <chutzpah@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 4 Apr 2014 14:02:35 +0000 (16:02 +0200)]
libfdisk: make qsort_r() optional
The function is no critical for fdisk functionality. The SUN label
verification will check for less issues. All the verification code is
optional ('v' fdisk command).
Dave Reisner [Wed, 2 Apr 2014 14:41:30 +0000 (10:41 -0400)]
switch_root: verify initramfs by f_type, not devno
As of linux 3.14, the initramfs device will have both major and
minor 0, causing our paranoia check to fail. Make this version agnostic
by checking the filesystem type, rather than a device number.
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Ruediger Meier [Fri, 21 Mar 2014 11:31:39 +0000 (12:31 +0100)]
mount: update mount.8 about barrier mount options defaults
This patch comes originally from Jan Kara <jack@suse.cz> and updates
the default behaviour of the kernel which has been changed some years
ago. See kernel docs
Documentation/filesystems/ext3.txt
Documentation/filesystems/ext4.txt
Karel Zak [Fri, 24 Jan 2014 12:58:40 +0000 (13:58 +0100)]
losetup: wait for udev
On system with /dev/lop-control the udevd creates /dev/loopN nodes.
It seems better to wait a moment after unsuccessful open(/dev/loopN)
and try it to open again.
The problem is pretty visible on systems where udevd also modifies
permission for loopN devices, then open() fails with EACCES when
losetup executed by non-root user (but user who is in "disk" group).
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1045432 Signed-off-by: Karel Zak <kzak@redhat.com>
Ruediger Meier [Wed, 26 Mar 2014 21:18:17 +0000 (22:18 +0100)]
lscpu: don't abort if cache size is unknown
There are systems where the size file does not exist. Most badly even
lscpu -p would abort allthough it does not use the size:
$ lscpu -p
lscpu: error: cannot open
/sys/devices/system/cpu/cpu0/cache/index0/size: No such file or directory
This patch does not abort in this case and prints "unknown size" in
human-readable case. For examle on this qemu pcc test machine:
$ lscpu
Architecture: ppc
CPU op-mode(s): 32-bit
Byte Order: Big Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 1
Model: Power Macintosh
BogoMIPS: 33.25
L1d cache: unknown size
L1i cache: unknown size
Ruediger Meier [Wed, 12 Mar 2014 13:53:20 +0000 (14:53 +0100)]
ipcs: fix ipc_msg_get_info fallback case
"ipcs -q" (case id < 0) was broken since v2.22-256-g35118df if /sys
is not usable. The main issue was that the use of msqid argument did not
cleanly distinguished between "queue identifier" and "index of kernel's
internal array".
Also now the fallback case and the regular case behave more equally
regarding it's return value (introducing another counter j).
Note that the case id >= 0 now performs a slower lookup. This could be
avoided but then we would better handle both case differently like it
was before the above mentioned cleanup commit.
Chris MacGregor [Thu, 27 Feb 2014 18:40:59 +0000 (10:40 -0800)]
hwclock: fix possible hang and other set_hardware_clock_exact() issues
In sys-utils/hwclock.c, set_hardware_clock_exact() has some problems when the
process gets pre-empted (for more than 100ms) before reaching the time for
which it waits:
1. The "continue" statement causes execution to skip the final tdiff
assignment at the end of the do...while loop, leading to the while condition
using the wrong value of tdiff, and thus always exiting the loop once
newhwtime != sethwtime (e.g., after 1 second). This masks bug # 2, below.
2. The previously-existing bug is that because it starts over waiting for the
desired time whenever two successive calls to gettimeofday() return values >
100ms apart, the loop will never terminate unless the process holds the CPU
(without losing it for more than 100ms) for at least 500ms. This can happen
on a heavily loaded machine or on a virtual machine (or on a heavily loaded
virtual machine). This has been observed to occur, preventing a machine from
completing the shutdown or reboot process due to a "hwclock --systohc" call in
a shutdown script.
The new implementation presented in this patch takes a somewhat different
approach, intended to accomplish the same goals:
It computes the desired target system time (at which the requested hardware
clock time will be applied to the hardware clock), and waits for that time to
arrive. If it misses the time (such as due to being pre-empted for too long),
it recalculates the target time, and increases the tolerance (how late it can
be relative to the target time, and still be "close enough". Thus, if all is
well, the time will be set *very* precisely. On a machine where the hwclock
process is repeatedly pre-empted, it will set the time as precisely as is
possible under the conditions present on that particular machine. In any
case, it will always terminate eventually (and pretty quickly); it will never
hang forever.
[kzak@redhat.com: - tiny coding style changes]
Signed-off-by: Chris MacGregor <chrismacgregor@google.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 5 Mar 2014 10:06:59 +0000 (11:06 +0100)]
chcpu: cleanup return codes
The code currently always return EXIT_SUCCESS, that's strange. It
seems better to return 0 on success, 1 on complete failure and 64 on
partial success.
Stewart Smith [Tue, 4 Mar 2014 04:27:27 +0000 (15:27 +1100)]
lscpu: don't assume filesystem supports d_type when searching for NUMA nodes
Not all file systems support the d_type field and simply checking for
d_type == DT_DIR in is_node_dirent would cause the test suite to fail
if run on (for example) XFS.
The simple fix is to check for DT_DIR or DT_UNKNOWN in is_node_dirent.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
If both -f and -t are given, flush the timing fd on each write, similar
to the behavior on the script fd. This allows playback of still-running
sessions, and reduces the risk of ending up with empty timing files when
script(1) exits abnormally.
Signed-off-by: Jesper Dahl Nyerup <nyerup@one.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Thomas Bächler [Sun, 16 Feb 2014 13:58:06 +0000 (14:58 +0100)]
libmount: initialize *root to NULL in mnt_table_get_root_fs
mnt_table_get_root_fs only works when *root is set to NULL. This
is not only undocumented, but also unintuitive. Fix it by initializing
*root inside mnt_table_get_root_fs.
Phillip Susi [Fri, 7 Feb 2014 22:01:20 +0000 (17:01 -0500)]
fix mkfs --verbose and man page
mkfs did not actually accept the long form --verbose option.
Also the man page seemed to indicate that version/verbose/help
options were passed to the filesystem specific utility when this
is not the case.
Andy Lutomirski [Fri, 24 Jan 2014 20:02:59 +0000 (12:02 -0800)]
setpriv: Fix --apparmor-profile
There were two bugs. First, trying to access /proc/self/attr/exec
with O_CREAT | O_EXCL has no chance of working. Second, it turns
out that the correct command to send is "exec", not "changeprofile".
Of course, there was no way to know this until: