It's been around a year and a half now that partx was rewritten,
and the legacy output should no longer be default.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* '2012wk23' of git://github.com/kerolasa/lelux-utiliteetit:
lsblk: use blkdev_scsi_type_to_name()
blkdev: add blkdev_scsi_type_to_name()
wipefs: use symbolic value for markup mode
eject: inform if CD-ROM drive is not ready
docs: clean up partx.8 manual
include: fix void pointer arithmetics warnings
sysfs: fix printf format warnings
build: fix unused parameter warnings
build: fix redundant redeclaration warnings
include: fix spurious list.h warnings
uuidd: use output redirection which works [checkbashisms]
blkid: fix realloc memory leak [cppcheck]
setarch: do not use -1 as array index [cppcheck]
valgrind --leak-check=full ./sys-utils/mount -t cifs //127.0.0.1/users /mnt/smb -o user=root,password=linux
....
==21359== Invalid read of size 1
==21359== at 0x415AC6: mnt_optstr_remove_option_at (optstr.c:310)
==21359== by 0x416358: mnt_optstr_apply_flags (optstr.c:716)
==21359== by 0x40DFBF: mnt_context_prepare_mount (context_mount.c:86)
==21359== by 0x40EB5A: mnt_context_mount (context_mount.c:782)
==21359== by 0x4058B0: main (mount.c:918)
==21359== Address 0x51cd5bf is 1 bytes before a block of size 10 alloc'd
==21359== at 0x4C297CD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21359== by 0x4C29957: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21359== by 0x415780: __mnt_optstr_append_option (optstr.c:188)
==21359== by 0x412822: mnt_fs_append_options (fs.c:764)
==21359== by 0x409288: mnt_context_append_options (context.c:733)
==21359== by 0x4053F0: main (mount.c:776)
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
valgrind --leak-check=full ./sys-utils/mount -t cifs //127.0.0.1/users /mnt/smb -o user=root,password=linux
....
==21359== 28 bytes in 1 blocks are definitely lost in loss record 1 of 1
==21359== at 0x4C298B2: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21359== by 0x415780: __mnt_optstr_append_option (optstr.c:188)
==21359== by 0x415CB5: mnt_optstr_set_option (optstr.c:387)
==21359== by 0x40D778: do_mount (context_mount.c:192)
==21359== by 0x40E6A9: mnt_context_do_mount (context_mount.c:685)
==21359== by 0x40EB7B: mnt_context_mount (context_mount.c:786)
==21359== by 0x4058B0: main (mount.c:918)
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
When locking the file fails with -n or -w option, caller has no way
to distinguish between the exit code 1 of the -c command,
and the exit code 1 of flock(1) caused by the conflicting lock.
Add a new -E <exitcode> (--conflict-exit-code) option to set
the exit code for the case of locking failure to any value.
mount -t cifs //127.0.0.1/users /mnt/smb -o user=root,password=linux
is incorrectly translated to
mount.cifs -o noexec,nosuid,nodev,user=root,password=linux ...
The command mount(8) should be sensitive to "user" (without "=<name>")
only. The correct cifs command line is:
mount.cifs -o user=root,password=linux
Addresses: https://bugzilla.novell.com/show_bug.cgi?id=766157
Signed-off-by: Karel Zak <kzak@redhat.com>
mount -t foo something /mnt/test -o user=root,password=linux
generates
"rw,noexec,nosuid,nodev,password=linux,,user=root"
options string for /sbin/mount.foo, the ",," is incorrect.
Signed-off-by: Karel Zak <kzak@redhat.com>
The libblkid always verify that /dev/disk/by-* symlinks match with
on-device LABELs/UUIDs. It means that all requests (e.g. mount -L |
-U) generates extra superblocks scans on the device.
Currently, many users and tools (GNOME, systemd, ...etc) use the
symlink directly and udev maintains the symlinks by inotify (+watch
rule). It seems better for system performance to disable the extra
paranoid mode and trust in udev.
Signed-off-by: Karel Zak <kzak@redhat.com>
# ll ~/xxx2
-rw-r--r-- 1 root root 500 Jun 12 14:30 /root/xxx2
old version:
# losetup -a
new version:
# losetup -a
/dev/loop0: [2052]:535312 (/root/xxx2)
The new version scans /sys/block/loopN, kernel >= 2.6.37 is required
otherwise fallback to the original not-so-smart /proc/partitions scan.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=730266
Signed-off-by: Karel Zak <kzak@redhat.com>
Replace inline version of similar, but less complete, functionality
with the lib/blkdev.c function. The function will inform if a type is
unknown, which appears as hex string value.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Remove bold & italic noise.
* Reformat text to be 70 characters wide.
* Use option and option argument highlights consistently.
* Indent option argument list for --nr.
* Squeeze examples where the same is done multiple different ways.
* Use URL and email macros where appropriate.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
all-io.h:18:9: warning: pointer of type 'void *' used in arithmetic [-pedantic]
all-io.h:38:9: warning: pointer of type 'void *' used in arithmetic [-pedantic]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sysfs.c:93:3: warning: format '%u' expects argument of type 'unsigned
int *', but argument 3 has type 'int *' [-Wformat]
sysfs.c:93:3: warning: format '%u' expects argument of type 'unsigned
int *', but argument 4 has type 'int *' [-Wformat]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/list.h:224:17: warning: ISO C forbids omitting the middle term of a ?: expression [-pedantic]
include/list.h:255:19: warning: ISO C forbids omitting the middle term of a ?: expression [-pedantic]
Compilation warned about that at least 110 times.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
possible bashism in misc-utils/uuidd.rc line 52 (should be >word 2>&1):
if pidofproc -p $PIDFILE $DAEMON >& /dev/null ; then
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Negative array index does technically work, but looks awkward and
can confuse static analyser such as cppcheck.
[sys-utils/setarch.c:267]: (error) Array index -1 is out of bounds
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
properly implemented fdisk_dev_has_topology() requires optimal
I/O size to detect that the device provides topology.
Unfortunately, currently used cxt->io_size maybe overwritten in
__discover_topology() to min_io_size.
This patch introduces cxt->optimal_io_size and keeps it independent on
cxt->io_size. The cxt->io_size is I/O size used by fdisk for alignment
calculation.
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch adds device topology discovery to the internal API. This
functionality is static only to the API and therefore hidden from general fdisk
code. Functionality itself doesn't really change, min_io_size, io_size, logical
and physical sector sizes and alignment offset are added to the fdisk_context
structure and elements are accessed from there. The logical sector size
(sector_size) is now unsigned long instead of unsigned int, this as no effect
otherwise.
A few things to notice:
- The patch is larger than I wanted but we need to modify function parameters
across fdisk and its labels to use the topology data from cxt-> instances.
Hopefully this will be pretty much it regarding this kind of modifications -
perhaps geometry will need something of the like too.
- The -b option must override internal discovery.
- A new helper function has added to verify if the device provides topology
information, this replaces the 'has_topology' global variable.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>