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>
* use more robust tls.m4 from gcc project
The old version (from util-linux-ng) used AC_TRY_COMPILE. That's
wrong. We need to use AC_RUN_IFELSE to check that the result is
link-able and executable.
The new version also test it TLS really works in multi-thread
applications.
* we need to detect TLS usability for cross-compiling
* this new version supports __thread keyword only, it seems that we
needn't to care about anything other
Signed-off-by: Karel Zak <kzak@redhat.com>
For example the /sbin/mount.fuse command calls
mount -i -f /dev/foo /absolut/path
and it does not make sense to canonicalize already absolute paths. The
new --no-canonicalize option allows to avoid unwanted readlink()
calls.
Signed-off-by: Karel Zak <kzak@redhat.com>
ubifs got merged into the linux kernel in v2.6.27. This patch adds its mount
options.
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
analog to mount gracefully ignoring non existing devices if the "nofail"
option is specified in fstab, also have fsck -A skip them. This way it's
possible to have devices optionally not available during boot but still
have them fsck'd if they are there.
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
This reverts commit a692a87459.
On Wed, Nov 18, 2009 at 03:33:12PM +0000, Daniel Drake wrote:
> Booting into a system this way just leads to problems because
> you cannot remount the root read-only at shutdown (leading to unclean
> shutdowns).
> Miklos Szeredi pointed out a trick to turn any directory into a
> mount point which avoids this problem. Therefore we can simplify
> switch_root again and simply document that its users should set
The utmp.ut_time is timeval.tv_sec (time_t) or int32_t. It's more
robust not to use ctime() or time() directly.
Signed-off-by: Karel Zak <kzak@redhat.com>
Linux kernel allows to use MS_RDONLY together with MS_BIND,
unfortunately the MS_RDONLY is silently ignored and the target
mountpoint is still read-write. Then we have 'ro' in mtab and 'rw' in
/proc/mounts.
This patch checks for this situation by access(2) or futimens(2)
(change atime) and mtab is properly updated and user informed.
Reported-by: Terry Burton <tez@terryburton.co.uk>
Signed-off-by: Karel Zak <kzak@redhat.com>
Typical "new partition" dialog looks like:
Partition number (1-4): 1
First sector (4-818687, default 4):
^^^^^^^^^
The range (e.g. 4-818687) depends on fdisk mode (DOS/non-DOS), but the
default value should be always aligned.
For example RAID5 device in the DOS mode:
Disk /dev/md0: 419 MB, 419168256 bytes
2 heads, 4 sectors/track, 102336 cylinders, total 818688 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 65536 bytes
Disk identifier: 0x081479c3
....
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First sector (4-818687, default 128): <---- !!!
Using default value 128
Last sector, +sectors or +size{K,M,G} (128-818687, default 818687): +10M
Command (m for help): p
....
Device Boot Start End Blocks Id System
/dev/md0p1 128 20607 10240 83 Linux
For non-DOS mode the range will be:
First sector (128-818687, default 128):
Signed-off-by: Karel Zak <kzak@redhat.com>
It's better to have disks without gaps between partitions, so it's
better to align ends of partitions.
Note, we don't care about end of partitions when the last sector has
been explicitly requested by user.
Signed-off-by: Karel Zak <kzak@redhat.com>
Disk /dev/md0: 419 MB, 419168256 bytes
2 heads, 4 sectors/track, 102336 cylinders, total 818688 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 65536 bytes
Disk identifier: 0x081479c3
Device Boot Start End Blocks Id System
/dev/md0p1 200 818687 409244 83 Linux
Partition 1 does not start on physical block boundary.
Signed-off-by: Karel Zak <kzak@redhat.com>
* inform user that phy.sector > log.sector
* warn user when alignment_offset is not provided does, DOS-compatible
mode is enabled and the default geo.sectors are not aligned
* suggest to change display units to sectors (oh yes, fdisk
default are cylinders...)
Signed-off-by: Karel Zak <kzak@redhat.com>
and print ('p' command) info about logical and physical sectors and
alignment_offset.
minimum_io_size
we don't use physical sector size directly, because on RAIDs is
better to use minimum_io_size (aka stripe chunk size). For disk drives
is minimum_io_size the same value as physical sector size.
alignment_offset
For compatibility with legacy operating systems some vendors provide
disks where logical and physical sectors are aligned at sector 63
(= geometry.sectors). In other words the physical 4KB sectors
start at LBA -1. Then the physical boundary is at:
alignment_offset + N * phy_sector_size
Signed-off-by: Karel Zak <kzak@redhat.com>
UI tools that read information from udev need a way how inform users
about ambivalent probing result (more valid filesystems on the
device).
This patch add a new ID_FS_AMBIVALENT variable:
ID_FS_AMBIVALENT=<info> <info> [ ...]
where <info> is:
<usage>:<type>[:<version>]
all strings are encoded (white spaces and utf8 are replaced with \hex).
For example:
# blkid -p -o udev /dev/sda1
ID_FS_AMBIVALEN=filesystem:vfat:FAT12 other:swap:2
Signed-off-by: Karel Zak <kzak@redhat.com>