Karel Zak [Mon, 9 Sep 2013 08:57:50 +0000 (10:57 +0200)]
libfdisk: fix SIGFPE
#0 recount_geometry at libfdisk/src/alignment.c:143
#1 fdisk_discover_geometry at libfdisk/src/alignment.c:205
#2 fdisk_context_assign_device at libfdisk/src/context.c:173
#3 print_partition_table_from_option at fdisks/fdisk.c:924
References: https://bugzilla.redhat.com/show_bug.cgi?id=1005566 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 8 Jul 2013 12:21:03 +0000 (14:21 +0200)]
lsblk: use devno to get mountpoint
The device (for example LVM logical volume) could be renamed and then
the device name from /proc/self/mountinfo does not match with reality.
So, we also need to check devno. Unfortunately we cannot completely
rely on devno, because for example btrfs uses psudo device numbers.
References: https://bugzilla.redhat.com/show_bug.cgi?id=980463 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 1 Jul 2013 13:59:16 +0000 (15:59 +0200)]
findmnt: make udev usage more robust
$ findmnt -rn --target /home/kzak/.bashrc -o UUID
uses libudev to ask for UUID, unfortunately /home/kzak is DM device
and libudev expects sysfs-like names (e.g. dm-0). We have to convert
the name to kernel devname.
Sami Kerola [Sun, 16 Jun 2013 18:53:42 +0000 (19:53 +0100)]
renice: exit with non-zero value when arguments cause warnings
This commit also fixes potential error counter wrap, which theoretically
could make command to exit with a success when it internally failed just
correct amount of times.
Aaron Lu [Thu, 6 Jun 2013 08:28:37 +0000 (16:28 +0800)]
eject: unlock door before issuing CDROMEJECT command
If user has inserted a disc into the drive, the drive will normally be
locked. When using eject command to eject the drive, we need to unlock
the door first, or the CDROMEJECT command will fail.
Though the 2nd attmpt to eject the drive with eject_scsi will succeed,
it actually does two things: first to unlock the door and then to eject
the tray, both with the SG_IO ioctl. The problem is, Linux SCSI driver
keeps track of if a device is in locked state or not, if we go with
SG_IO to do the unlocking, the driver will not be aware of the unlocking
and would think the drive is locked while actually it has already been
unlocked by the first SG_IO command.
Fix this by issuing a unlock door command before the CDROMEJECT command
in cdrom_eject. Prior to this fix, the following output is expected when
there is a disc inside:
[aaron@aaronlu util-linux-2.22.2]$ eject -v /dev/sr0
eject: device name is `/dev/sr0'
eject: /dev/sr0: mounted on /run/media/aaron/CD_ROM
eject: /dev/sr0: is whole-disk device
eject: /dev/sr0: is removable device
eject: /run/media/aaron/CD_ROM: unmounting
eject: /dev/sr0: trying to eject using CD-ROM eject command
eject: CD-ROM eject command failed
eject: /dev/sr0: trying to eject using SCSI commands
eject: SCSI eject succeeded
After this fix, the following output is expected:
[aaron@aaronlu util-linux-2.22.2]$ ./eject -v /dev/sr0
lt-eject: device name is `/dev/sr0'
lt-eject: /dev/sr0: mounted on /run/media/aaron/CD_ROM
lt-eject: /dev/sr0: is whole-disk device
lt-eject: /dev/sr0: is removable device
lt-eject: /run/media/aaron/CD_ROM: unmounting
lt-eject: /dev/sr0: trying to eject using CD-ROM eject command
lt-eject: CD-ROM eject command succeeded
And the SCSI device's locked state is correct now.
Eric S. Raymond [Mon, 10 Jun 2013 19:48:41 +0000 (15:48 -0400)]
Replace .IP o with .IP \(bu, using the [nt]roff bullet character.
This will improve the quality of generated HTML. There is a cost,
which is that most terminal emulators will just display the bullet
as a (less visible) dot. An alternative to this change would be
to use a * character for the bullet.
Gilles Espinasse [Mon, 13 May 2013 14:52:28 +0000 (16:52 +0200)]
tests: new warning fix
2.23 added -Wstrict-prototypes check. Fix make check showing
CC tests/helpers/test_md5.o
tests/helpers/test_md5.c:8: warning: function declaration isn't a prototype
Karel Zak [Tue, 21 May 2013 09:32:29 +0000 (11:32 +0200)]
build-sys: always check for setns() and unshare() libs functions
$ ./configure --disable-unshare
$ make nsenter
CC sys-utils/nsenter.o
In file included from sys-utils/nsenter.c:36:0:
./include/namespace.h:31:19: error: static declaration of ‘unshare’ follows non-static declaration
In file included from /usr/include/sched.h:42:0,
from sys-utils/nsenter.c:23:
/usr/include/bits/sched.h:86:12: note: previous declaration of ‘unshare’ was here
make: *** [sys-utils/nsenter.o] Error 1
We have to always check for the libc function independently on
--disable-{unshare,nsenter} to avoid collision between local and libc
declarations.
Reported-by: "Gabor Z. Papp" <gzp@papp.hu> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 14 May 2013 08:32:56 +0000 (10:32 +0200)]
libmount: don't ignore root fs on umount -a
The release v2.22 (the new umount) introduces a regression when root
fs is excluded from umount --all. There is not reason for this
exception. The libmount should be smart enough to disable mtab update
after rootfs umount.
Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Mike Frysinger [Wed, 8 May 2013 22:12:04 +0000 (18:12 -0400)]
standard SEE ALSO section of man pages
The standard format is to seperate each entry with a comma, and
for each one to be on a line by itself. Most util-linux pages
follow this, but a few do not.
The function sets loopdev size according to backing file size. The
problem is that the backing file could be a block device where
stat.st_size is zero, so we have to use blkdev_get_size() for block
devices.
Addresses: https://bugs.archlinux.org/task/35193 Reported-by: Dave Reisner <d@falconindy.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 6 May 2013 15:20:03 +0000 (17:20 +0200)]
libblkid: fix blkid_parse_tag_string() to ignore incomplete tags
fstab entry:
FOO= / btrfs defaults 1 1
Program received signal SIGABRT, Aborted.
0x00007f016ccd8819 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
at ../sysdeps/unix/sysv/linux/libc_fatal.c:196
Reported-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>