]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
ext4: fix punch hole for inline_data file systems
authorTheodore Ts'o <tytso@mit.edu>
Sat, 24 Aug 2019 02:38:00 +0000 (22:38 -0400)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 18 Oct 2019 08:26:12 +0000 (04:26 -0400)
commitb463b41db8943d6dc2f9418cb29f7609ee13a4da
tree8e8f2ff6fb34ad55000650babc4c3276abaac0d5
parentac62b54c5a2191fdbe38e600926838ec7847acfb
ext4: fix punch hole for inline_data file systems

BugLink: https://bugs.launchpad.net/bugs/1848046
commit c1e8220bd316d8ae8e524df39534b8a412a45d5e upstream.

If a program attempts to punch a hole on an inline data file, we need
to convert it to a normal file first.

This was detected using ext4/032 using the adv configuration.  Simple
reproducer:

mke2fs -Fq -t ext4 -O inline_data /dev/vdc
mount /vdc
echo "" > /vdc/testfile
xfs_io -c 'truncate 33554432' /vdc/testfile
xfs_io -c 'fpunch 0 1048576' /vdc/testfile
umount /vdc
e2fsck -fy /dev/vdc

Cc: stable@vger.kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/ext4/inode.c