Arnaud Mouiche [Thu, 17 Nov 2011 17:03:04 +0000 (18:03 +0100)]
small bug in mkfs.cramfs + patch
mkfs.cramfs on version v2.17.2 has a small bug when dealing with very small
filesystems. look at upstream code on git, and the issue is still here.
ex:
$ cd /tmp
$ mkdir content
$ echo hello > content/a
$ echo hello > content/b
$ mkfs.cramfs content content.cramfs
not enough space allocated for ROM image (4090 allocated, 4096 used)
Here is a patch for fixing (simply rounding to page size AFTER eleminating
doubles).
Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Cong Wang [Fri, 18 Nov 2011 08:51:37 +0000 (16:51 +0800)]
fallocate: add FALLOC_FL_PUNCH_HOLE support
Recent Linux kernel supports FALLOC_FL_PUNCH_HOLE in fallocate(2).
This patch adds FALLOC_FL_PUNCH_HOLE support to fallocate utility,
by introducing a new option -p|--punch-hole.
[kzak@redhat.com: - fix merge conflict in fallocate.1]
Cc: Karel Zak <kzak@redhat.com> Cc: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Bernhard Voelker [Wed, 16 Nov 2011 16:57:27 +0000 (17:57 +0100)]
prlimit: add support for executing a command
prlimit.c: Alternatively to applying the limits to an existing process via the
--pid option, allow a command to be executed. Adapted usage() accordingly.
prlimit.1: mention new syntax.
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
The lock file cannot be opened in read-write mode by default, because
then we cannot use flock(1) to lock executable files.
The read-write mode for lock files is necessary on NFSv4 where
flock(2) is emulated by by fcntl() -- this situation is possible to
detect by flock(2) EIO error.
This patch reverts the default to O_RDONLY and use O_RDWR only if EIO
error is detected.
Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Bernhard Voelker [Wed, 16 Nov 2011 10:55:43 +0000 (11:55 +0100)]
prlimit: fix case when PID is given later
# prlimit --nofile=:4000 --pid $$
When the PID is given later than a partially given limit, then prlimit
used the current PID for getting the missing part (hard, soft) of the
limit.
Factored out the retrieval of the unknown limit from parse_prlim() to
new get_unknown_hardsoft() which is to be called by do_prlimit() based
on the struct prlimit member 'modify' set by add_prlim().
[kzak@redhat.com: - use prlimit->mofify as mask
- add soft vs. hard limit check from another
Bernhard's patch]
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 16 Nov 2011 09:54:07 +0000 (10:54 +0100)]
prlimit: fix error message
- differentiate between set and get operations
- add limit name to the error message
- remove PID from the message (whole util works always with only one
PID, so this info is superfluous)
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Bernhard Voelker [Mon, 14 Nov 2011 01:47:57 +0000 (02:47 +0100)]
prlimit: show all limits if called without options
Fix option parsing: prlimit ran into usage() if called
without arguments which should only be done for surplus
arguments. Instead, it should display all limits.
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
fdisk: split delete_partition() off from dos_delete_partition()
This accidentally fixes a mistake printing the "Partition n is deleted"
message as the 'i' variable get decremented or incremented in case of
logical partitions.
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
This allows the creation of a new label if the disk already has an existing
SGI disklabel without working around this problem such as creating a DOS
disklabel or overwriting with zero the partition table (problem reported in
'Gentoo Linux/MIPS Handbook').
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Karel Zak [Mon, 14 Nov 2011 12:25:36 +0000 (13:25 +0100)]
Merge branch 'sys-utils-3rd' of https://github.com/kerolasa/lelux-utiliteetit
* 'sys-utils-3rd' of https://github.com/kerolasa/lelux-utiliteetit:
ldattach: add default case to switches
ldattach: convert debug macro to function
ldattach: check numeric user inputs with strtol_or_err
ldattach: align with howto-usage-function.txt
ldattach: fix coding style
docs: add long options to readprofile.8
readprofile: fix coding style
readprofile: use libc error printing facilities
readprofile: add long options
docs: align tunelp.8 with howto-man-page.txt
docs: add long options to tunelp.8
tunelp: add long options and align with howto-usage-function.txt
tunelp: use libc error printing facilities
tunelp: use symbolic exit values
tunelp: fix coding style
switch_root: add nls support
switch_root: align with howto-usage-function.txt
unshare: align with howto-usage-function.txt
rtcwake: align with howto-usage-function.txt
setsid: add long options and fix coding style
Karel Zak [Fri, 11 Nov 2011 11:48:38 +0000 (12:48 +0100)]
wipefs: improve -a, use blkid_do_wipe()
Some filesystems (e.g. FAT) is possible to detect in many ways -- for
example if a magic string is stored on more places on the device. The
current implementation always removes from the device only the firstly
detected possibility.
# wipefs -a /dev/sdb1
8 bytes were erased at offset 0x00000036 (vfat): 46 41 54 31 36 20 20 20
1 bytes were erased at offset 0x00000000 (vfat): eb
2 bytes were erased at offset 0x000001fe (vfat): 55 aa
libblkid: silence a format string warning [-Wformat]
Fix the following clang warning:
exfat.c:130:41: warning: conversion specifies type 'unsigned short' but
the argument has type 'uint8_t' (aka 'unsigned char') [-Wformat]
blkid_probe_sprintf_version(pr, "%hu.%hu",
~~^
%c
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>