Karel Zak [Tue, 4 Aug 2015 09:26:45 +0000 (11:26 +0200)]
mkfs.cramfs: remove dead code [coverity scan]
There two possible ways, print error and exit on too long names or
truncate the filename -- but it's impossible to do both in the same
code :-) It seems that code already assumes warning on long names, so
let's remove errx() and keep the behavior in dependence on -E.
Sami Kerola [Sun, 2 Aug 2015 20:24:08 +0000 (21:24 +0100)]
bash-completion: update few options changed since v2.26
Attempt to find and update all changes to command line options that has
not been reflected in bash-completion files in between versions v2.26 to
v2.27-rc1.
Sami Kerola [Sat, 1 Aug 2015 18:01:00 +0000 (19:01 +0100)]
mkfs.minix: re-fix block count maths
Error, that Joshua Hudson already pointed out, creapped back to commit da41ff5 when changes were applied from mailbox rather than git remote, as
the corrected change had included some accidental rubbish.
Reference: http://www.spinics.net/lists/util-linux-ng/msg11764.html
Reference: http://www.spinics.net/lists/util-linux-ng/msg11848.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Milan Broz [Thu, 30 Jul 2015 14:18:28 +0000 (16:18 +0200)]
lsblk: Display mountpoint even for top-level device
If a filesystem is mounted on top-level block device
with existing partitions, the mountpoint is not displayed
in the lsblk output.
This situation can happen by a configuration mistake
and lsblk could be used to detect such a mistake.
This patch allows searching for a mountpoint for all displayed
devices, not only for leaf nodes.
(It should be pretty cheap operation, mtab is parsed only once.)
For example: lsblk /dev/loop1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop1 7:1 0 128M 0 loop /mnt/tst
└─loop1p1 259:0 0 127M 0 loop
Sami Kerola [Wed, 24 Jun 2015 08:15:19 +0000 (09:15 +0100)]
docs: make fsck.minix(8) more pretty
Use real table to device list, add missing new paragraph markers, remove
braces that cause reader to wonder if test is meant or not, squeeze error
code list, move references to bottom of the manual, and use mail or web
address macro when possible.
Sami Kerola [Wed, 24 Jun 2015 08:15:14 +0000 (09:15 +0100)]
mkfs.minix: check requested blocks will not exceed available on device
Earlier user could define more blocks than device, or backing file for
loopback file system, had available. That lead to a system crash with
following commands;
The minix driver should probably not hang the whole kernel, but the least
that mkfs.minix ought to do is not to let users to get that condition
quite as easily.
Sami Kerola [Wed, 24 Jun 2015 08:15:11 +0000 (09:15 +0100)]
mkfs.minix: remove unuseful code
Checks about inodes vs block sizes does not add much robustness. Both
values are derived at compilation time from struct minix_inode size, and
they form full definition circle.
Bad block check for none-block devices should not be supressed, user
requested it so let him have it.
Check for st_rdev == 0x0300 || st_rdev == 0x0340 was unreachable.
Joshua Hudson [Wed, 24 Jun 2015 08:15:08 +0000 (09:15 +0100)]
mkfs.minix: increase maximum minix v2 and v3 file system sizes
mkfs.minix misbehaves when attempting to create a large v2 or v3
filesystem. I finally traced it down to attempting to create too many
inodes so that the first zone is past 65535 blocks in. This obviously
doesn't work as the on-disk superblock says this is a 16 bit integer.
I wrote a patch that catches this, clamps to the absolute v2/v3 limit
(like it already does for v1), and sets the blocks per inode to a more
reasonable ratio when exceeding half a gigabyte. Having a half-gig
filesystem with most files being smaller than 3k isn't really reasonable.
I suppose if you don't want to adjust inode sizes automatically you could
take that part out, and it will just crab sooner.
Given the non-attention in the code, I suspect nobody ever had cause to
try such a big minix filesystem. Well I have my reasons involving some
deeply embedded work where ext2 would place too much strain on the
hardware.
Reviewed-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Joshua Hudson <joshudson@gmail.com>
Karel Zak [Thu, 30 Jul 2015 07:28:19 +0000 (09:28 +0200)]
libmount: make mnt_get_filesystems() more robust [clang analyze]
The mnt_free_filesystems() relies on NULL as the last item in the
filesystems array. It's necessary to keep NULL there after failed
strdup() too, because we call mnt_free_filesystems() to deallocate
after error.
Alex Bligh [Wed, 15 Jul 2015 18:01:48 +0000 (19:01 +0100)]
logger: Add support to logger for RFC6587 octet counting
This patch adds support to logger for RFC6587 octet counting.
RFC6587 provides support for two sorts of framing:
1. Octet counting (at RFC6587 s3.4.1)
In essence each frame is preceded by a decimal length and a
space.
2. Non-transparent framing (at RFC6587 s3.4.2), also called
'octet stuffing'
In essence each frame is terminated by a `\n`
Prior to this patch, logger used option 2 (non-transparent framing)
on TCP, and used no framing on UDP. After this patch, the default
behaviour is unchanged, but if the '--octet-count' option is supplied,
option 1 is used for both TCP and UDP. Arguably octet count framing
makes little sense on UDP, but some servers provide it and this
allows testing of those servers.