]> err.no Git - util-linux/log
util-linux
14 years agofdisk: use 1MiB offset and grain always when possible
Karel Zak [Mon, 15 Feb 2010 14:55:22 +0000 (15:55 +0100)]
fdisk: use 1MiB offset and grain always when possible

It would be nice to minimize dependence between the disk layout and
disk topology. We have to follow disk topology for alignment_offset
and huge (> 1MiB) I/O sizes only. For all others disks we can use 1MiB
grain and 1MiB offset.

Reported-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: add -c option (switch off DOS mode)
Karel Zak [Mon, 15 Feb 2010 13:39:30 +0000 (14:39 +0100)]
fdisk: add -c option (switch off DOS mode)

 * add -c to allows to switch off DOS mode from command line

 * recommend sectors (command 'u' or option -u)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: fix ALIGN_UP
Karel Zak [Mon, 15 Feb 2010 13:06:56 +0000 (14:06 +0100)]
fdisk: fix ALIGN_UP

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: fallback for topology values
Karel Zak [Mon, 15 Feb 2010 12:29:04 +0000 (13:29 +0100)]
fdisk: fallback for topology values

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: cleanup help, add -h option
Karel Zak [Mon, 15 Feb 2010 09:08:03 +0000 (10:08 +0100)]
fdisk: cleanup help, add -h option

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: update fdisk tests
Karel Zak [Fri, 12 Feb 2010 21:10:52 +0000 (22:10 +0100)]
tests: update fdisk tests

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: use more elegant way to count and check alignment
Karel Zak [Fri, 12 Feb 2010 20:43:03 +0000 (21:43 +0100)]
fdisk: use more elegant way to count and check alignment

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoinclude: add min/max macros
Karel Zak [Fri, 12 Feb 2010 20:42:46 +0000 (21:42 +0100)]
include: add min/max macros

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: advise users to use "modprobe", not "insmod"
Karel Zak [Fri, 12 Feb 2010 18:58:45 +0000 (19:58 +0100)]
mount: advise users to use "modprobe", not "insmod"

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=562394
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocfdisk: set '[New]' as default item on menu for non allocated space instead of '...
Francesco Cosoleto [Fri, 12 Feb 2010 17:51:29 +0000 (18:51 +0100)]
cfdisk: set '[New]' as default item on menu for non allocated space instead of '[Help]'.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agobuild-sys: add missing tests for libuuid and libblkid
Karel Zak [Fri, 12 Feb 2010 11:43:07 +0000 (12:43 +0100)]
build-sys: add missing tests for libuuid and libblkid

$ make checkconfig
misc-utils/blkid.c : HAVE_TERMIO_H
misc-utils/blkid.c : HAVE_TERMIOS_H
shlibs/blkid/src/getsize.c : HAVE_FSTAT64
shlibs/blkid/src/llseek.c : HAVE_LLSEEK_PROTOTYPE
shlibs/blkid/src/llseek.c : HAVE_LSEEK64_PROTOTYPE
shlibs/uuid/src/gen_uuid.c : HAVE_SA_LEN*/
shlibs/uuid/src/gen_uuid.c : HAVE_SYS_SOCKET_H
shlibs/uuid/src/gen_uuid.c : HAVE_SYS_SYSCALL_H

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoblkid: fix #ifdef HAVE_TERMIO[S]_H
Karel Zak [Fri, 12 Feb 2010 09:32:34 +0000 (10:32 +0100)]
blkid: fix #ifdef HAVE_TERMIO[S]_H

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: remove duplicate #includes
Karel Zak [Fri, 12 Feb 2010 09:21:05 +0000 (10:21 +0100)]
build-sys: remove duplicate #includes

$ make checkincludes
fsck/fsck.c: errno.h is included more than once.
lib/canonicalize.c: string.h is included more than once.
shlibs/blkid/src/blkidP.h: stdio.h is included more than once.
shlibs/blkid/src/devname.c: string.h is included more than once.
shlibs/blkid/src/devno.c: string.h is included more than once.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocal: fix first day of the week calculation on BE systems
Karel Zak [Thu, 11 Feb 2010 15:29:05 +0000 (16:29 +0100)]
cal: fix first day of the week calculation on BE systems

This reverts commit dcb54fafb128ab41772ae217afc6a7612e2cc446,
"cal: remove gcc-ism from nl_langinfo() call".

The code:

int wfd = (int)(intptr_t) nl_langinfo(_NL_TIME_WEEK_1STDAY);

does not work on big-endian machines. The original solution based on
union is better.

Note that the "type punning" is not gcc-ism any more, it's allowed
by C99 (6.5.2.3).

Reported-by: Joseph Jezak <josejx@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocfdisk: set '[Quit]' as default menu item on first run instead of '[Bootable]'.
Francesco Cosoleto [Wed, 10 Feb 2010 11:42:26 +0000 (12:42 +0100)]
cfdisk: set '[Quit]' as default menu item on first run instead of '[Bootable]'.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agomount: warn users that mtab is read-only
Karel Zak [Thu, 11 Feb 2010 12:54:06 +0000 (13:54 +0100)]
mount: warn users that mtab is read-only

In repair mode the root filesystem is read-only and mtab file is not
up to date.

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=427183
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: fix and update old fdisk tests
Karel Zak [Tue, 9 Feb 2010 15:24:51 +0000 (16:24 +0100)]
tests: fix and update old fdisk tests

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add fdisk alignment tests
Karel Zak [Tue, 9 Feb 2010 14:47:32 +0000 (15:47 +0100)]
tests: add fdisk alignment tests

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: cleanup warnings
Karel Zak [Thu, 4 Feb 2010 14:02:16 +0000 (15:02 +0100)]
fdisk: cleanup warnings

* don't print:

The number of cylinders for this disk is set to 12161.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

  we really don't care about MS-DOS or extremely old LILO.

* inform users that DOS-compatible mode is bad and deprecated thing
  (It's difficult to use 2048 sectors grain or 4KiB sectors or
   alignment_offset in DOS mode where all is based on cylinders...)

* don't check for cylinders boundary in non-DOS mode

* inform about sector and I/O sizes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: fix default first sector
Karel Zak [Tue, 9 Feb 2010 10:06:42 +0000 (11:06 +0100)]
fdisk: fix default first sector

The previous release 2.17 introduces aligned defaults for the first
and last sectors on the partition. Unfortunately, there is endless
loop when the code looks for first unused aligned sector.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: cleanup alignment, default to 1MiB offset
Karel Zak [Thu, 4 Feb 2010 12:43:37 +0000 (13:43 +0100)]
fdisk: cleanup alignment, default to 1MiB offset

* add heuristic to detect that the device does not provide
  topology information. We can use topology if:

- alignment_offset is not 0
- or optimal_io_size is not 0
- or minimal_io_size is not power of 2

* default to 1MiB offset for the start of the first partition
  if topology is unknown. This (2048 512-byte sectors)
  is Windows Vista default.

* use optimal_io_size, minimal_io_size or 1MiB as a grain for
  partitions alignment

Note that this all is used when DOS-compatible mode is disabled.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: fix check_alignment()
Karel Zak [Tue, 9 Feb 2010 09:32:29 +0000 (10:32 +0100)]
fdisk: fix check_alignment()

The old version of check_alignment() does not work with extended
partitions.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: don't check alignment_offset against geometry
Karel Zak [Mon, 8 Feb 2010 16:45:42 +0000 (17:45 +0100)]
fdisk: don't check alignment_offset against geometry

The alignment_offset is compensation for DOS compatible partitioning.

It usually matches with disk geometry (e.g. 63 sectors), but the
offset is also exported from phy.disks to RAIDs there the geometry
don't match with the offset. So.. don't print unnecessary warning.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: don't return error on empty files
Karel Zak [Thu, 4 Feb 2010 21:19:38 +0000 (22:19 +0100)]
libblkid: don't return error on empty files

Currently, the library does not allow to initialize blkid_probe if the
file (or block device) is empty. The empty file is reported as an
error. That's wrong. The empty file should be interpreted as a file
without any FS or PT. It means that

blkid_do_{probe,safeprobe,fullprobe}()

have to return 1 ("nothing").

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agowipefs: ignore devices with partition table
Karel Zak [Thu, 4 Feb 2010 20:18:34 +0000 (21:18 +0100)]
wipefs: ignore devices with partition table

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: use "optimal I/O size" in warnings
Karel Zak [Thu, 28 Jan 2010 22:34:05 +0000 (23:34 +0100)]
fdisk: use "optimal I/O size" in warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: use optimal_io_size
Karel Zak [Thu, 28 Jan 2010 18:42:04 +0000 (19:42 +0100)]
fdisk: use optimal_io_size

 * rename the minimum_io_size variable to io_size
 * use blkid_topology_get_optimal_io_size() for io_size initialization
 * use blkid_topology_get_minimum_io_size() as a fallback solution for
   io_size initialization

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agologin: check that after tty reopen we still work with a terminal
Karel Zak [Thu, 28 Jan 2010 15:25:52 +0000 (16:25 +0100)]
login: check that after tty reopen we still work with a terminal

 * the login code assumes that stdin is a terminal, it's better to
   check (by isatty()) that after tty reopen we still have a terminal

 * this patch also removes very old obscure fallback for situations where
   ttyname() returns nothing (then ttyn = "/dev/tty??"). I guess that the
   fake string was originally for utmp records or so. Currently (in last 10
   years...) code requires that the tty name is a real open-able file.
   It means the fake tty name is completely useless.

Reported-by: Yann Droneaud <yann@droneaud.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agologin: use fd instead of pathname for update tty's owner and permissions
Yann Droneaud [Mon, 25 Jan 2010 22:12:09 +0000 (23:12 +0100)]
login: use fd instead of pathname for update tty's owner and permissions

To avoid some nasty races, use the only true tty:
the one already opened, don't use the path.

Signed-off-by: Yann Droneaud <yann@droneaud.fr>
14 years agoblkid: add newline when only one value is printed
Karel Zak [Wed, 27 Jan 2010 17:16:06 +0000 (18:16 +0100)]
blkid: add newline when only one value is printed

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: more robust minix probing
Karel Zak [Wed, 27 Jan 2010 14:01:13 +0000 (15:01 +0100)]
libblkid: more robust minix probing

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agologin: don't link PAMed version with libcrypt
Karel Zak [Wed, 27 Jan 2010 12:31:16 +0000 (13:31 +0100)]
login: don't link PAMed version with libcrypt

The login, chsh and chfn utils don't need to be linked against libcrypt.
The libcrypt library is necessary only when login utils are not liked
with PAM.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=559196
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: update documentation about barrier mount options
Jan Kara [Wed, 13 Jan 2010 17:07:33 +0000 (18:07 +0100)]
mount: update documentation about barrier mount options

Signed-off-by: Jan Kara <jack@suse.cz>
14 years agonamei: fix man page formatting
Vladimir Brednikov [Sun, 10 Jan 2010 21:01:26 +0000 (00:01 +0300)]
namei: fix man page formatting

14 years agolibblkid: fix segfault in drdb
Matthias König [Tue, 12 Jan 2010 12:58:28 +0000 (13:58 +0100)]
libblkid: fix segfault in drdb

Check if blkid_probe_get_buffer() returns NULL to avoid dereferencing
a zero pointer resulting in a segfault.

Signed-off-by: Matthias König <mk@phasorlab.de>
14 years agolibblkid: don't probe for GPT and Unixware PT on floppies
Karel Zak [Wed, 20 Jan 2010 22:51:13 +0000 (23:51 +0100)]
libblkid: don't probe for GPT and Unixware PT on floppies

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: add sanity checks for FAT to DOS PT parser
Karel Zak [Wed, 20 Jan 2010 22:30:20 +0000 (23:30 +0100)]
libblkid: add sanity checks for FAT to DOS PT parser

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoblkid: probe for PT, don't probe for FS on small whole-disks
Karel Zak [Wed, 20 Jan 2010 20:18:15 +0000 (21:18 +0100)]
blkid: probe for PT, don't probe for FS on small whole-disks

 * blkid(8) in low-level mode probes for PT now (blkid is replacement
   for devkit-disks-part-id)

 * add ID_PART_TABLE_TYPE=<name> to blkid(8) udev output

 * don't probe for FS/RAIDs on small devices when PT is detected

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: rewrite blkid_probe_get_buffer()
Karel Zak [Wed, 20 Jan 2010 19:01:59 +0000 (20:01 +0100)]
libblkid: rewrite blkid_probe_get_buffer()

The library does not use any buffer with fixed size any more. The new
version calls read() for necessary data only.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: update FS test images
Karel Zak [Tue, 19 Jan 2010 15:46:08 +0000 (16:46 +0100)]
tests: update FS test images

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: add minimal sizes for OCFS and GFS
Karel Zak [Tue, 19 Jan 2010 15:23:14 +0000 (16:23 +0100)]
libblkid: add minimal sizes for OCFS and GFS

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: don't call read() per FAT dir-entry on large disks
Karel Zak [Tue, 19 Jan 2010 12:45:51 +0000 (13:45 +0100)]
libblkid: don't call read() per FAT dir-entry on large disks

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: read whole SB buffer (69kB) on large disks
Karel Zak [Tue, 19 Jan 2010 12:43:39 +0000 (13:43 +0100)]
libblkid: read whole SB buffer (69kB) on large disks

 - on large disks read whole SB buffer
 - new blkid_probe_is_tiny() version based on flags

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: set minimal size for jfs, reiser, swap and zfs
Karel Zak [Tue, 19 Jan 2010 00:12:06 +0000 (01:12 +0100)]
libblkid: set minimal size for jfs, reiser, swap and zfs

.. and don't probe for swap or ext. journal on tiny disks.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: disable read-ahead when probing device files
Linus Torvalds [Mon, 18 Jan 2010 23:09:21 +0000 (00:09 +0100)]
libblkid: disable read-ahead when probing device files

Read-ahead doesn't work very well on device probing, and can hurt a lot
when we do essentially random accesses on very slow devices. So disable it
if possible.

[kzak@redhat.com: - add posix_fadvise() configure test]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: call read() per FAT root dir entry
Karel Zak [Mon, 18 Jan 2010 22:58:46 +0000 (23:58 +0100)]
libblkid: call read() per FAT root dir entry

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: fix RAIDs tests
Karel Zak [Mon, 18 Jan 2010 15:49:38 +0000 (16:49 +0100)]
tests: fix RAIDs tests

 - test images was too small (limit is 1474560 bytes)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: read() optimization for small devices
Karel Zak [Mon, 18 Jan 2010 14:43:25 +0000 (15:43 +0100)]
libblkid: read() optimization for small devices

 - don't read the begin (69kB) of the device by one large read()
 - fill in the SB buffer dynamically
 - use extra buffer for FATs root dir entries (FAT FS label)
   on small devices to avoid large reads

Detect FAT12 on 1.4MB device (number of bytes):

Old version:

  $ strace -e read blkid -p floppy.img 2>&1 | \
awk -F ' = ' 'BEGIN {x=0} /read/ && !/.*ELF/ {x += $2} END { print x }'
  73292

New version:
  $ strace -e read blkid -p floppy.img 2>&1 | \
awk -F ' = ' 'BEGIN {x=0} /read/ && !/.*ELF/ {x += $2} END { print x }'
  8192

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: restrict RAID/FS proving for small devices (1.4MiB)
Karel Zak [Mon, 18 Jan 2010 11:50:36 +0000 (12:50 +0100)]
libblkid: restrict RAID/FS proving for small devices (1.4MiB)

 - don't ignore @size in blkid_probe_set_device()
 - ignore extremely small devices (<= 1024 bytes, e.g. extended partitions)
 - don't use safe probing for small devices
 - don't probe for RAIDs on small devices

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: don't include scsi.h
Karel Zak [Wed, 13 Jan 2010 09:51:57 +0000 (10:51 +0100)]
fdisk: don't include scsi.h

The fdisksunlabel.c header file is unnecessary for fdisk/fdisksunlabel.h.

Reported-by: Thomas Stalder <thomas@netsolux.ch>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: release++ (v2.17)
Karel Zak [Thu, 7 Jan 2010 21:41:05 +0000 (22:41 +0100)]
build-sys: release++ (v2.17)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update v2.17 ReleaseNotes
Karel Zak [Thu, 7 Jan 2010 21:31:31 +0000 (22:31 +0100)]
docs: update v2.17 ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update AUTHORS file
Karel Zak [Thu, 7 Jan 2010 21:01:16 +0000 (22:01 +0100)]
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: merge changes
Karel Zak [Thu, 7 Jan 2010 20:59:56 +0000 (21:59 +0100)]
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: update zh_CN.po (from translationproject.org)
Ray Wang [Thu, 7 Jan 2010 20:54:22 +0000 (21:54 +0100)]
po: update zh_CN.po (from translationproject.org)

14 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Thu, 7 Jan 2010 20:54:22 +0000 (21:54 +0100)]
po: update pl.po (from translationproject.org)

14 years agopo: update fi.po (from translationproject.org)
Lauri Nurmi [Thu, 7 Jan 2010 20:54:22 +0000 (21:54 +0100)]
po: update fi.po (from translationproject.org)

14 years agopo: update eu.po (from translationproject.org)
Mikel Olasagasti [Thu, 7 Jan 2010 20:54:22 +0000 (21:54 +0100)]
po: update eu.po (from translationproject.org)

14 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Thu, 7 Jan 2010 20:54:21 +0000 (21:54 +0100)]
po: update cs.po (from translationproject.org)

14 years agotests: refresh lscpu tests
Karel Zak [Thu, 7 Jan 2010 20:49:40 +0000 (21:49 +0100)]
tests: refresh lscpu tests

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolscpu: add {32,64}-bit CPU modes detection
Karel Zak [Thu, 7 Jan 2010 16:34:03 +0000 (17:34 +0100)]
lscpu: add {32,64}-bit CPU modes detection

This patch add "CPU op-mode(s):" field that prints all supported CPU
operation modes. The field is based on CPU flags:

rm (real mode)          16-bit
tm (transparent mode)   32-bit
lm (long mode)          64-bit

Example:

$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
CPU(s):                2
Thread(s) per core:    1
Core(s) per socket:    2
CPU socket(s):         1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 15
Stepping:              11
CPU MHz:               1600.000
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              4096K

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: sleep-after-sync and fsync usage
Karel Zak [Wed, 6 Jan 2010 10:12:43 +0000 (11:12 +0100)]
fdisk: sleep-after-sync and fsync usage

It seems that sleep() after sync() is unnecessary legacy. It's very
probably unnecessary since kernel 1.3.20. For example the libparted
does not to use sleep() at all.

It seems that more important is fsync() usage in fdisks. For more
details see

  http://marc.theaimsgroup.com/?l=linux-kernel&m=105545785306867&w=3
  http://marc.theaimsgroup.com/?l=linux-kernel&m=105545848607353&w=3
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=276369

Currently we use fsync() in fdisk only. This patch also add fsync() to
sfdisk and cfdisk.

Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=276369
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=502639
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: fix typo in mount.8
Karel Zak [Mon, 4 Jan 2010 13:27:52 +0000 (14:27 +0100)]
mount: fix typo in mount.8

Reported-by: Joe Peterson <joe@skyrush.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: DRBD support for blkid
Bastian Friedrich [Mon, 4 Jan 2010 13:13:13 +0000 (14:13 +0100)]
libblkid: DRBD support for blkid

DRBD is the Distributed Replicated Block Device, a replication service for low
level block devices.

The attached patch provides libblkid detection for v08 type drbd devices
(v08 is the current one).

[kzak@redhat.com: - port to libblkid 2.17
                  - use BLKID_USAGE_RAID flag
                  - remove BLKID_IDINFO_TOLERANT flag
                  - note that DRBD is supported since kernel v2.6.33-rc1]

Signed-off-by: Bastian Friedrich <bastian.friedrich@collax.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agosfdisk: confused about disk size
Karel Zak [Mon, 4 Jan 2010 10:34:13 +0000 (11:34 +0100)]
sfdisk: confused about disk size

The size of disk in the sfdisk command is based on number of cylinders
(this is probably legacy from CHS epoch). That's wrong because
partitions are addressed in sectors (LBA), so cylinders don't provide
necessary resolution (granularity).

On Sat, Jan 02, 2010 at 01:01:16PM +0100, Giulio wrote:
> $ cat /sys/block/sda/size
184549376
>
> $ sfdisk  -d /dev/sda > part.dump
> $ cat part.dump
> # partition table of /dev/sda
> unit: sectors
>
> /dev/sda1 : start=     2048, size=  2097152, Id=83
> /dev/sda2 : start=  2099200, size= 12582912, Id=83
> /dev/sda3 : start= 14682112, size= 84934656, Id=83
> /dev/sda4 : start= 99616768, size= 84932608, Id=83
>
>
> $ sfdisk  -L  /dev/sda < part.dump
> Checking that no-one is using this disk right now ...
> OK
>
> Disk /dev/sda: 11487 cylinders, 255 heads, 63 sectors/track
> Old situation:
> Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
>
>    Device Boot Start     End   #cyls    #blocks   Id  System
> /dev/sda1          0+    130-    131-   1048576   83  Linux
> /dev/sda2        130+    913-    784-   6291456   83  Linux
> /dev/sda3        913+   6200-   5287-  42467328   83  Linux
> /dev/sda4       6200+  11487-   5287-  42466304   83  Linux
> Warning: given size (84932608) exceeds max allowable size (84921887)

 disk size:

 based on number of cylinders:   11487 * 8225280 = 94483791360 bytes
 based on number of sectors:     184549376 * 512 = 94489280512 bytes

 end of 4th partition (LBA in bytes):
                     (99616768 + 84932608) * 512 = 94489280512

Reported-by: Giulio <giulioo@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopg: command enters infinite loop
Mike Frysinger [Sat, 26 Dec 2009 19:56:54 +0000 (14:56 -0500)]
pg: command enters infinite loop

In a multibyte locale such as en_GB.UTF-8, the pg command cannot handle files
containing a form feed character (ASCII 0x0c) at the start of a line. The
program enters an infinite loop.

I've traced the problem to the function endline_for_mb in file pg.c. The code
assumes that the libc function wcwidth will return a nonnegative value, which
is not true for a form feed character. wcwidth returns -1 and the unsigned
variable "pos" goes into underflow.

I'll attach a patch which tests whether the character is printable before
calling wcwidth. If not, it uses instead the width of the constant L'?' which
is later used to replace nonprintable characters. I trust that we can assume
printability of this constant :-)

Steps to Reproduce:
1. Select a multibyte locale (tested with en_GB.UTF-8)
2. Create a file with a form feed character (0x0c) at the start of a line.
3. Try to display this file using the pg command.

Reported-by: Mark Calderbank <m.calderbank@iname.com>
Reported-by: Mike Frysinger <vapier@gentoo.org>
Addresses: https://bugs.gentoo.org/297717
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoumount: add --no-canonicalize
Karel Zak [Thu, 17 Dec 2009 11:33:21 +0000 (12:33 +0100)]
umount: add --no-canonicalize

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: disable --no-canonicalize for non-root users
Karel Zak [Thu, 17 Dec 2009 11:27:16 +0000 (12:27 +0100)]
mount: disable --no-canonicalize for non-root users

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add silicon RAID test
Karel Zak [Tue, 15 Dec 2009 13:08:14 +0000 (14:08 +0100)]
tests: add silicon RAID test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add promise RAID test
Karel Zak [Tue, 15 Dec 2009 13:07:53 +0000 (14:07 +0100)]
tests: add promise RAID test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add nvidia RAID test
Karel Zak [Tue, 15 Dec 2009 13:07:10 +0000 (14:07 +0100)]
tests: add nvidia RAID test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add lsi RAID test
Karel Zak [Tue, 15 Dec 2009 13:06:18 +0000 (14:06 +0100)]
tests: add lsi RAID test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add jmicron RAID test
Karel Zak [Tue, 15 Dec 2009 13:05:54 +0000 (14:05 +0100)]
tests: add jmicron RAID test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add isw RAID test
Karel Zak [Tue, 15 Dec 2009 13:04:44 +0000 (14:04 +0100)]
tests: add isw RAID test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add hpt45x RAID test
Karel Zak [Tue, 15 Dec 2009 13:04:02 +0000 (14:04 +0100)]
tests: add hpt45x RAID test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add hpt37x RAID test
Karel Zak [Tue, 15 Dec 2009 13:01:40 +0000 (14:01 +0100)]
tests: add hpt37x RAID test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add adaptec RAID test
Karel Zak [Tue, 15 Dec 2009 13:01:03 +0000 (14:01 +0100)]
tests: add adaptec RAID test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: rename highpoint RAIDs to hpt{37,45}x_raid_member
Karel Zak [Tue, 15 Dec 2009 11:30:02 +0000 (12:30 +0100)]
libblkid: rename highpoint RAIDs to hpt{37,45}x_raid_member

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: fix highpoint37x detection
Karel Zak [Tue, 15 Dec 2009 10:55:27 +0000 (11:55 +0100)]
libblkid: fix highpoint37x detection

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: fix Adaptec RAID detection
Karel Zak [Tue, 15 Dec 2009 01:17:28 +0000 (02:17 +0100)]
libblkid: fix Adaptec RAID detection

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: add LGPLv2+ to list of licenses
Karel Zak [Mon, 14 Dec 2009 11:47:56 +0000 (12:47 +0100)]
docs: add LGPLv2+ to list of licenses

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: release++ (v2.17-rc3)
Karel Zak [Thu, 10 Dec 2009 21:05:07 +0000 (22:05 +0100)]
build-sys: release++ (v2.17-rc3)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update v2.17 ReleaseNotes
Karel Zak [Thu, 10 Dec 2009 21:01:13 +0000 (22:01 +0100)]
docs: update v2.17 ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: merge changes
Karel Zak [Thu, 10 Dec 2009 20:55:38 +0000 (21:55 +0100)]
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: update eu.po (from translationproject.org)
Mikel Olasagasti Uranga [Thu, 10 Dec 2009 20:50:46 +0000 (21:50 +0100)]
po: update eu.po (from translationproject.org)

14 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Thu, 10 Dec 2009 20:50:46 +0000 (21:50 +0100)]
po: update cs.po (from translationproject.org)

14 years agodocs: add ngettext() into TODO file
Karel Zak [Thu, 10 Dec 2009 12:14:55 +0000 (13:14 +0100)]
docs: add ngettext() into TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: fix msgid bugs
Karel Zak [Thu, 10 Dec 2009 12:04:41 +0000 (13:04 +0100)]
po: fix msgid bugs

Reported-by: Petr Pisar <petr.pisar@atlas.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: bug (typo) in function MD5Final()
Karel Zak [Thu, 10 Dec 2009 10:59:46 +0000 (11:59 +0100)]
lib: bug (typo) in function MD5Final()

On Wed, Dec 09, 2009 at 10:08:38PM +0000, Jochen Voss wrote:
> while experimenting with coccinelle, I accidentally found what I
> believe is a bug in util-linux-ng release 2.17-rc2 (downloaded
> today). The problem is the following code in lib/md5.c (around line
> 153):
>
>     void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
>     {
>   [...]
>   memset(ctx, 0, sizeof(ctx));        /* In case it's sensitive */
>     }
>
> The third argument of memset should probably be the size of 'struct
> MD5Context' instead of the size of the pointer.  So my guess is
> that the memset line should be
>
>   memset(ctx, 0, sizeof(*ctx));       /* In case it's sensitive */
>
> instead.  I don't know whether this actually causes a problem,
> but the comment makes it seem possible that it does.

Note, this typo does not have any impact on the utils in the
util-linux-ng project, because we don't use MD5 for any security
sensitive data or cryptographic stuff. The typo also does not have any
impact to the final MD5 hashes.

Reported-by: Jochen Voss <voss@seehuhn.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: release++ (v2.17-rc2)
Karel Zak [Wed, 9 Dec 2009 11:02:58 +0000 (12:02 +0100)]
build-sys: release++ (v2.17-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update v2.17 ReleaseNotes
Karel Zak [Wed, 9 Dec 2009 10:44:38 +0000 (11:44 +0100)]
docs: update v2.17 ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update AUTHORS file
Karel Zak [Wed, 9 Dec 2009 10:39:33 +0000 (11:39 +0100)]
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: merge changes
Karel Zak [Wed, 9 Dec 2009 10:37:57 +0000 (11:37 +0100)]
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Wed, 9 Dec 2009 10:31:37 +0000 (11:31 +0100)]
po: update pl.po (from translationproject.org)

14 years agodocs: update TODO list
Karel Zak [Tue, 8 Dec 2009 19:39:52 +0000 (20:39 +0100)]
docs: update TODO list

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoflock: fix hang when parent ignores SIGCHLD
Mike Frysinger [Mon, 7 Dec 2009 14:18:17 +0000 (15:18 +0100)]
flock: fix hang when parent ignores SIGCHLD

If flock is executed from a process which has set SIGCHLD to SIG_IGN, then
flock will eat cpu and hang indefinitely if given a command to execute.
So before we fork(), make sure to set SIGCHLD handling back to the default
so that the later waitpid() doesn't freak out on us.

[kzak@redhat.com: - add a check for waitpid() return value]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update TODO file
Karel Zak [Fri, 4 Dec 2009 19:58:19 +0000 (20:58 +0100)]
docs: update TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agotests: remove vol_id from tests
Karel Zak [Fri, 4 Dec 2009 19:30:16 +0000 (20:30 +0100)]
tests: remove vol_id from tests

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: check for pkg-config before gtk-doc
Karel Zak [Fri, 4 Dec 2009 19:01:37 +0000 (20:01 +0100)]
build-sys: check for pkg-config before gtk-doc

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: fix blkid_fstatat() code
Karel Zak [Fri, 4 Dec 2009 17:44:57 +0000 (18:44 +0100)]
libblkid: fix blkid_fstatat() code

Signed-off-by: Karel Zak <kzak@redhat.com>