Commit Graph

9954 Commits

Author SHA1 Message Date
Ruediger Meier 0e76536579 blkdiscard: fix timeval comparison inclusive usecs
We will see if this makes our "--step" tests reliable.

CC: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-09 18:23:29 +01:00
Karel Zak 6589a1632b libmount: use fstatat(AT_NO_AUTOMOUNT) for mountpoints
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-09 10:26:16 +01:00
Karel Zak 624996a950 libmount: add cgroup2 pseudo FS
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-08 12:16:27 +01:00
Karel Zak 24500575ac Merge branch 'patch-1' of https://github.com/frioux/util-linux
* 'patch-1' of https://github.com/frioux/util-linux:
  Fix subtle typo
2015-12-08 12:10:39 +01:00
Karel Zak f07a82c9d8 build-sys: fix typo and more all RT to the same place
typo : s/timer_createx/timer_create/

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-08 11:52:13 +01:00
fREW Schmidt 100a3ab516 Fix subtle typo 2015-12-07 14:16:30 -08:00
Karel Zak 96561604e2 libsmartcols: fix right-aligned logic for last column
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-07 15:10:23 +01:00
Karel Zak 717fff869e cfdisk: use new libsmartcols functionality to fix output
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-07 12:23:26 +01:00
Karel Zak 05c1123bc3 libsmartcols: don't use fprintf() when count cells
fprintf("%*s") is based on bytes, no cells.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-07 12:22:29 +01:00
Karel Zak df73852b6e libsmartcols: add scols_table_enable_nowrap()
This allows to use libsmartcols in ncurses programs without any
additional voodoo.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-07 12:03:52 +01:00
Karel Zak 86688c378b Revert "cfdisk: make sure that output fits to terminal width"
This reverts commit ed99eac0e2.
2015-12-07 10:42:15 +01:00
Benno Schulenberg 5330b97e94 lsns: improve formatting and wording of the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-12-04 11:20:00 +01:00
Karel Zak 28a2df8dc0 libblkid: fix buffers mapping on 32bit archs
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-03 12:24:22 +01:00
Karel Zak e03f29b694 line: keep stdin unbuiffered
$ printf 'a\nb\n' | echo $(./line) :: $(./line)

broken version:

 a ::

fixed version:

 a :: b

Addresses: https://github.com/karelzak/util-linux/issues/236
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-02 15:01:23 +01:00
Karel Zak 352740e88e libmount: fix is-mounted check for btrfs
fstab:
  /dev/sdc        /mnt/test       btrfs   subvol=/anydir
  /mnt/test       /mnt/test2      auto    bind

and "mount -a" does not detect that /mnt/test2 is already mounted.

Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-02 13:38:51 +01:00
Sukadev Bhattiprolu bd9b94d12a lscpu: Print physical cpu information
lscpu currently prints information for CPUs configured in the system.
In case of KVM or other virtualized guest operating systems, this
refers to the virtual system, and bears no relation to the physical
topology of the system.

It would be useful if lscpu could also display the physical topology
info when available:

	$ ./lscpu
	Architecture:          ppc64le
	Byte Order:            Little Endian
	CPU(s):                16
	On-line CPU(s) list:   0-15
	Thread(s) per core:    1
	Core(s) per socket:    1
	Socket(s):             16
	NUMA node(s):          1
	Model:                 IBM pSeries (emulated by qemu)
	Hypervisor vendor:     KVM
	Virtualization type:   para
	L1d cache:             64K
	L1i cache:             32K
	NUMA node0 CPU(s):     0-15
	Physical sockets:      2		<<< New
	Physical chips:        4		<<< New
	Physical cores/chip:   4		<<< New

For now, physical topology information is available on platforms that
support the following RTAS (Real time abstraction service) call provided
by librtas:

	rtas_get_sysparm(PROCESSOR_MODULE_INFO).

Currently this call is available to the PowerVM (pHYP) guests on PowerPC.
With a patch propoosed to PowerKVM, this RTAS call would also be available
to PowerKVM guests.

Based on input from Nishanth Aravamudan and Karel Zak.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
2015-12-02 11:33:58 +01:00
Karel Zak 4ba2a6e515 Merge branch 'races' of git://github.com/kerolasa/lelux-utiliteetit 2015-12-02 10:27:43 +01:00
Karel Zak 0e4f6b2a26 lsns: improve man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 17:27:22 +01:00
Karel Zak e069296ed8 include: add missing header file
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 15:44:26 +01:00
Karel Zak 8ff3d5d077 lsns: fix usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 13:50:51 +01:00
Karel Zak 635493655e lsns: add details to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 13:00:14 +01:00
Karel Zak 1880a5781f lsns: sort namespaces, avoid duplicate entries in tree output
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 12:31:40 +01:00
Karel Zak 82a437c79d lsns: remove unwanted comment
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 11:45:11 +01:00
Karel Zak 1bb4fe24e3 lsns: add man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 11:40:51 +01:00
Karel Zak 304fbe8b3c lsns: filter by NS type
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 15:55:31 +01:00
Karel Zak 969d3d15aa lsln: allows to list namespace processes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 14:06:05 +01:00
Karel Zak c600d82a3a libsmartcols: make sure we have space for ascii art
* more verbose output about columns width counting
* strlen_line() does not care about space between columns and extra
  tree ASCII art. Let's assume that all termwith is possible to use
  for this extra stuff, it means that maximal buffer size is
  biggest_line + termwidth.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 12:53:42 +01:00
Karel Zak 440f73b7bc libsmartcols: allow to reduce tree columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 11:43:05 +01:00
Karel Zak 9dfd601976 lsns: read all processes when --task specified
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 14:24:09 +01:00
Karel Zak 13f6b9db1e build-sys: add lsns to gitignore
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 13:57:22 +01:00
Karel Zak a52852d37a lsns: add USER and UID
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 13:56:31 +01:00
Karel Zak 04a5cb58b6 namei: move icache to lib/
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 13:56:01 +01:00
Karel Zak 8a2045620e lsns: new command
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-26 14:09:45 +01:00
Karel Zak 0e756daeb6 lslocks: use stuff from lib/procutils
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-25 14:17:22 +01:00
Karel Zak 5184d93630 agetty: don't ignore netlink on select()
agetty uses NETLINK_ROUTE to be notified about network interface
changes. Unfortunately, the code that monitor the netlink FD does not
increment number of the monitored file descriptors when call
select(2), so the netlink notifications are invisible for agetty.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1278906
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-24 17:44:38 +01:00
Sami Kerola 010d5a670b
mesg: fix multiple races
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:39 +00:00
Sami Kerola f5320b483c
fdformat: fix block device open race
This fix makes fdformat also to detect if block device is busy, and warn if
the device is misaligned.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:38 +00:00
Sami Kerola 80c320fac1
mkswap: fix block device open race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:38 +00:00
Sami Kerola 8a4eb983d8
mkfs.minix: fix block device open race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:38 +00:00
Sami Kerola 98b4f74e1f
mkfs.bfs: allow creating file system to a file
Most, if not all, linux file systems allow this and there should not be a
reason why bfs could not do the same.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:37 +00:00
Sami Kerola 5fc7694a54
mkfs.bfs: fix block device open race
This fix makes mkfs.bfs also to detect if block device is busy, and warn if
the device is misaligned.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:37 +00:00
Sami Kerola 8fe1e638fa
lib/blkdev: add open_blkdev_or_file() function
Purpose of this function is to open a path that is potentially pointing to a
block device or file without races.  The function also proper open(3) flags
are used to check the device is not busy, and finally warning is been
printed if a block device happens to be misaligned.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:05 +00:00
Sami Kerola 3f684db0d9
include/fileutils: add is_same_inode() check
Check if a file descriptor and path or stat structure are represent the same
file.  This function is needed for TACTOU avoidance.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:55:34 +00:00
Karel Zak 0172ebba52 tests: update ZFS test
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-19 19:08:00 +01:00
Casper Ti. Vector dcbba45cc5 include: remove now useless linux_reboot.h. 2015-11-19 12:07:41 +01:00
Casper Ti. Vector e52b58e627 ctrlaltdel: use reboot() provided by libc, assuming it is 1-adic. 2015-11-19 12:07:04 +01:00
Karel Zak f98d9641a3 losetup: clean up --direct-io
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-19 11:57:05 +01:00
Ming Lei faeef4d2e9 losetup: support list direct io
So that user can see if DIO is set for current loop device.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
2015-11-19 11:27:36 +01:00
Ming Lei 64c3bb3cb7 losetup: support ioctl cmd of LOOP_SET_DIRECT_IO
From v4.4, linux kernel starts to support direct I/O and
AIO to backing file for loop driver, so allow losetup to
enable the feature by using LOOP_SET_DIRECT_IO ioctl cmd.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
2015-11-19 11:27:36 +01:00
Karel Zak 710dd49239 blkid: don't mark zfs as RAID
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-18 11:55:35 +01:00