Based on Pádraig Brady review:
* use is_nul() from coreutils rather then memcmp()
* always call skip_hole() (SEEK_DATA)
* fix possible overflows
Signed-off-by: Karel Zak <kzak@redhat.com>
It's more efficient to skip already known holes by SEEK_DATA (seek to
the next area with data).
Thanks to Pádraig Brady.
Signed-off-by: Karel Zak <kzak@redhat.com>
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>
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>
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>
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>
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>
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>
* 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>
This option tries to detect chunk of '\0's and punch a hole, making the file
sparse in-place.
[kzak@redhat.com: - fix coding style, use xalloc.h and err.h]
Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
Signed-off-by: Karel Zak <kzak@redhat.com>
Future patches will add more calls to fallocate(), so it will be useful to have
all these tricks inside a function.
The error message when fallocate is not supported is slightly changed: the file
name is not printed as a prefix because is not available in the context of the
function. Also, to only print one of the two possible errors (as happens when
using directly exit()), an else clause was added.
Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
The functionality is already there, with --punch-hole, but the text was for the
preallocation case only.
Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
This option caps the delay between updates, to avoid long pauses in
transcript playback.
Signed-off-by: Jesper Dahl Nyerup <nyerup@one.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The man page stated that the PRIO_MAX is 20. While this
is correct, the header definition is wrong and the max
value is actually 19.
[kzak@redhat.com: - remove PRIO_MAX from man page, kernel syscalls
use hardcoded numbers for the priority limits]
Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The wording was confusing and suidperl has gone the way
of the dodo, and really didn't need mentionting in mount.8.
Signed-off-by: Phillip Susi <psusi@ubuntu.com>
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.
Signed-off-by: Phillip Susi <psusi@ubuntu.com>
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:
commit 3eea57c26e49a5add4c053a031cc2a1977b7c48e
Author: John Johansen <john.johansen@canonical.com>
Date: Wed Feb 27 03:44:40 2013 -0800
apparmor: fix setprocattr arg processing for onexec
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Earlier determination that used kill with signal zero to pid was prone to
false positive reports, due reuse of pid space and unrelated processes.
New function is_phantom() tries do a little bit better job, but fails to
be perfect. It seems linking to gether utmp session start time or
terminal id with /proc/<pid>/ information is not as simple as one might
hope.
Reported-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
[kzak@redhat.com: - fix coding style,
- use xalloc in all code,
- fix strtol usage]
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Setting in .gitconfig to do 'git apply --whitespace=fix' automatically
turned automation against user.
Frankencommit: 4d2f0d08f6
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This is done to keep things simple, when considering tests, for both 64
and 32 bit architectures. Setting the upper limit of a year value to to
2^31-1 (2147483646) should be enough for anyone.
Reported-by: Mike Frysinger <vapier@gentoo.org>
Reference: http://www.spinics.net/lists/util-linux-ng/msg08662.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The error message is expected for "really wanted" set of filesystems
(extN, ..), otherwise it does not make sense for filesystems like
btrfs or xfs.
Reported-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Karel Zak <kzak@redhat.com>
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>