linux/fs/udf
Jan Kara 36ec52ea03 udf: Fix file corruption when appending just after end of preallocated extent
When we append new block just after the end of preallocated extent, the
code in inode_getblk() wrongly determined we're going to use the
preallocated extent which resulted in adding block into a wrong logical
offset in the file. Sequence like this manifests it:

xfs_io -f -c "pwrite 0x2cacf 0xd122" -c "truncate 0x2dd6f" \
  -c "pwrite 0x27fd9 0x69a9" -c "pwrite 0x32981 0x7244" <file>

The code that determined the use of preallocated extent is actually
stale because udf_do_extend_file() does not create preallocation anymore
so after calling that function we are sure there's no usable
preallocation. Just remove the faulty condition.

CC: stable@vger.kernel.org
Fixes: 16d0556568 ("udf: Discard preallocation before extending file with a hole")
Signed-off-by: Jan Kara <jack@suse.cz>
2023-01-26 16:46:35 +01:00
..
balloc.c udf: Drop VARCONV support 2023-01-26 16:46:32 +01:00
dir.c udf: Convert udf_readdir() to new directory iteration 2023-01-09 10:39:51 +01:00
directory.c udf: Drop VARCONV support 2023-01-26 16:46:32 +01:00
ecma_167.h udf: Get rid of 0-length arrays in struct fileIdentDesc 2021-08-11 16:54:44 +02:00
file.c udf: Allocate blocks on write page fault 2023-01-26 16:46:35 +01:00
ialloc.c udf: Fix error handling in udf_new_inode() 2021-12-15 13:08:34 +01:00
inode.c udf: Fix file corruption when appending just after end of preallocated extent 2023-01-26 16:46:35 +01:00
Kconfig docs: filesystems: fix renamed references 2020-04-20 15:45:22 -06:00
lowlevel.c udf: Unify types in anchor block detection 2023-01-26 16:46:32 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
misc.c udf: Drop VARCONV support 2023-01-26 16:46:32 +01:00
namei.c udf: Protect rename against modification of moved directory 2023-01-26 16:46:34 +01:00
osta_udf.h udf: Get rid of 0-length arrays 2021-08-11 16:54:44 +02:00
partition.c udf: Use udf_bread() in udf_get_pblock_virt15() 2023-01-26 16:46:33 +01:00
super.c udf: Use udf_bread() in udf_load_vat() 2023-01-26 16:46:33 +01:00
symlink.c udf: Convert udf_symlink_filler() to use udf_bread() 2023-01-26 16:46:33 +01:00
truncate.c udf: Drop VARCONV support 2023-01-26 16:46:32 +01:00
udf_i.h udf: Preserve link count of system files 2023-01-09 10:39:53 +01:00
udf_sb.h udf: Drop VARCONV support 2023-01-26 16:46:32 +01:00
udfdecl.h udf: Allocate blocks on write page fault 2023-01-26 16:46:35 +01:00
udfend.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
udftime.c udf: convert inode stamps to timespec64 2018-06-27 13:58:00 +02:00
unicode.c udf: Fix iocharset=utf8 mount option 2021-08-12 16:07:09 +02:00