Package: e2fsprogs Version: 1.42.13-1 Severity: normal Dear maintainer,
When the file system size is not given, mke2fs determine the appropriate size by using the size of the support device. However, when the extended option "offset" is given, it doesn't seem to reduce the fs size to take the offset into account. An actual case of this bug can be when the support "device" is a regular file and the size of the file system is not given because it's the last partition in the virtual disk. How to reproduce: 1) Create a virtual disk qemu-img create -f raw testing.img 10M 2) Create several partitions parted -s testing.img mklabel gpt parted -s -a none testing.img mkpart ESP fat32 0 4M parted -s -a none testing.img mkpart linux ext4 4M 10M 3) Check the file size -rw-r--r-- 1 celelibi celelibi 10485760 nov. 1 08:32 testing.img 4) Create the ext2 file system mke2fs -E offset=4000256 testing.img 5) The file size has increased by an mount equal to the offset -rw-r--r-- 1 celelibi celelibi 14486016 nov. 1 08:32 testing.img Proposed solution: 1) Take the offset into account when computing the optimal file system size. 2) Emit a warning when the offset option is given without a file system size and the support file is a regular file instead of a block device as it may overwrite subsequent partitions if it's not the last one. Best regards, Celelibi -- System Information: Debian Release: stretch/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental') Architecture: i386 (x86_64) Kernel: Linux 3.10.11 (SMP w/2 CPU cores; PREEMPT) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Init: sysvinit (via /sbin/init) Versions of packages e2fsprogs depends on: ii e2fslibs 1.42.13-1 ii libblkid1 2.27-3 ii libc6 2.19-22 ii libcomerr2 1.42.13-1 ii libss2 1.42.13-1 ii libuuid1 2.27-3 ii util-linux 2.27-3 e2fsprogs recommends no packages. Versions of packages e2fsprogs suggests: pn e2fsck-static <none> pn gpart <none> ii parted 3.2-7 -- no debconf information

