Add missing mount options to ext3 and ext4 filesystems. This also
remove resize option information from the man page.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This makes it very convenient to use make use of privileged actions
on CONFIG_USER_NS enabled kernels, without having to manually tinker
with uid_map and gid_map to obtain required credentials (as those
given upon unshare() vanish with call to execve() and lot of userspace
checks for euid==0 anyway).
Usage example:
$ unshare --uts
unshare: unshare failed: Operation not permitted
$ unshare --user --uts
[nfsnobody@odvarok ~]$ hostname swag
hostname: you must be root to change the host name
$ unshare -r --uts
[root@odvarok util-linux]# hostname swag
[root@odvarok util-linux]#
[kzak@redhat.com: - move code to map_id()
- use all-io.h
- add paths to pathnames.h]
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Karel Zak <kzak@redhat.com>
lscpu fails to print proper NUMA node values in a system with
discontinuous nodes. This patch adds support by creating a nodeidx
array to map node numbers.
Based on patch from Madhavan Srinivasan <maddy@linux.vnet.ibm.com>.
Reported-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The option is unsupported since v2.23, let's cleanup man pages and
code to remove it at all.
Reported-by: "Dale R. Worley" <worley@alum.mit.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
* read /proc/self/mountinfo to get filesystems
* ignore net and pseudo filesystems
* ignore unaccessible filesystems (over mounted by another FS)
* read disk sysfs queue/discard_granularity to detect is discard support
* call FITRIM ioctl
* silently ignore EOPNOTSUPP (for example LUKS without discard) and ENOTTY
(for example vfat) errors
Signed-off-by: Karel Zak <kzak@redhat.com>
$ umount LABEL=foo
currently does not work for non-root users as umount uses the
LABEL= as a path in sanitize_path().
Signed-off-by: Karel Zak <kzak@redhat.com>
The libmount does not care if we set source or target, it's able to
swap it, but the mount.c function sanitize_paths() does not work as
expected if we set NAME=value as target. It means that
$ mount LABEL=foo
does not work for non-root users (since 51e3530cdc, v2.24).
This patch also checks if source or target is specified more
than once.
Signed-off-by: Karel Zak <kzak@redhat.com>
Let's keep usage() simple and details in the man page. The current
brief description in usage() seems confusing for some users.
Signed-off-by: Karel Zak <kzak@redhat.com>
There is also idea (by Lennart) to add --propagation=[shared|private|slave|off]
to unshare(1), but it seems unnecessary and too complex as everyone can call
mount(8) after unshare(1) to setup a proper namespace.
Signed-off-by: Karel Zak <kzak@redhat.com>
The mount man page said the default permissions are read for
everyone, but it is in fact, read and execute.
Signed-off-by: Phillip Susi <psusi@ubuntu.com>
lscpu don't work correctly on my system with:
$ cat /sys/devices/system/cpu/possible
0-1,4-5,8-9,12-13
[kzak@redhat.com: - coding style,
- add commit message
- add real_cpu_num() macro,
- fix functions where we need idx as well as CPU number]
Signed-off-by: Karel Zak <kzak@redhat.com>
Also put in one hard space, to keep text and number separated when
the translated string should be too long.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Kernel aligns the device size, but the offset where the device starts
is not required to be aligned.
# losetup --offset 32 -f file.img
is just fine, the final size of the look device will be (in sectors)
(backing_file_size - offset) >> 9
so we have to do the same in userspace when we check for successful
set capacity ioctl.
Signed-off-by: Karel Zak <kzak@redhat.com>
non-root user on device that is not mounted:
$ umount /mnt/flash
umount: /mnt/flash: umount failed: Operation not permitted
this is true, because we cannot evaluate permissions as there is no
entry in mtab, but users expect something more helpful -- for example
umount: /mnt/flash: not mounted
References: https://bugs.archlinux.org/task/31647
Signed-off-by: Karel Zak <kzak@redhat.com>
The lscpu tool only shows the current and max CPU frequencies, however,
in many scenarios this is not enough. If there are energy saving situations
(like some CPUs being idle, or not fully used) the cpugov can lower this value.
Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>