fallocate: add --verbose, clean up usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
fallocate: improve --dig-holes

 * don't use --length to specify hole size, always use stat.st_blksize

 * use --offset and --length to specify offset within the file (like
   another fallocate operations)

Signed-off-by: Karel Zak <kzak@redhat.com>
ionice: add the way to specify the target processes with pgid and uid

ioprio_get and ioprio_set system call accept not only process ID but
also process group ID(pgid) and user ID(uid) to specify the target
process(es).  However, ionice command accepts only process ID.  With
this patch a user can specify the target processes with pgid(-P
option) and uid(-u option).

[kzak@redhat.com: - tiny cleanup in usage()]

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: accept (deleted) path suffix in mountinfo file

Addresses: debian bug #711183
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: make the mountinfo parser more robust

... sorry, the previous change to the parser was too stupid.

Signed-off-by: Karel Zak <kzak@redhat.com>
su: don't use kill(0, ...) when propagate signal

The current code uses kill(0, caught_signal) after regular
signal cleanup and before exit (all just to make shells happy).

Unfortunately, kill(0, ...) is a bad idea. It seems better to use
kill(getpid(), ...) otherwise we kill our parent process too.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1063887
Signed-off-by: Karel Zak <kzak@redhat.com>
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.

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: fix trailing spaces in cal(1) stuff

Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
tests: avoid executing dirname(1) command

Bash parameter expansion does the same thing.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tools: add usage information to checkconfig.sh

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
docs: make hexdump.1 color specification easier to understand

Fix also spacing, input line lenghts, and troff table for data that is a
table.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests: align last.1 with recent phantom detection

None existing account is not still-logged-in but gone mysteriously,
assuming wtmp logout markup is missing.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
swaplabel: wrong version number in check

$ swaplabel /dev/sda2
swaplabel: /dev/sda2: unsupported swap version '1'

The mkswap does not allow any other version, so swaplabel(8) must be
wrong.

Reference: https://github.com/karelzak/util-linux/blob/master/disk-utils/mkswap.c#L520
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
isosize: move file name printing after error determination

Earlier the filename printing was buffered, and exit at error made output
to appear in front of prompt.  Output below demonstrates the brokenness.

prompt> isosize /etc /
isosize: /etc: might not be an ISO filesystem
isosize: read error on /etc: Is a directory
/etc: prompt>

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests: add isosize --sectors and --divisor tests

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
isosize: make --divisor to require argument

Silly bug, only the short option -d allowed divisor argument.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests: update ionice test

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: update libmount tabdiff tests

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: fdisk now prints SGI system partitions too

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: make tests to run parallel

Unarguably this change makes test output to be more messy, but when I
compare run time tells with clear numbers parallel is quicker.  For me
the quickness is important factor.  Running test suite always after a
change is preferrably quick, and if something is indicated to be broken
it is ok to spend time in drilling down what happen.

$ time ./tests/run.sh --parallel=5
[...]
real    1m48.037s

Same without parallelization.

$ time ./tests/run.sh
real    3m16.687s

The default is changed to be parallel, where job count is same as number
of CPUs.

[kzak@redhat.com: - propagate --parallel into function.sh
                  - don't use extra title for non-parallel execution
                  - disable by default]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>