diff options
author | 2023-01-23 14:18:47 +0100 | |
---|---|---|
committer | 2023-01-26 16:46:35 +0100 | |
commit | 36ec52ea038b18a53e198116ef7d7e70c87db046 (patch) | |
tree | ccc09721412b9051dc357523b5a175fcd8bf4e6e /drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c | |
parent | udf: Do not allocate blocks on page writeback (diff) | |
download | wireguard-linux-36ec52ea038b18a53e198116ef7d7e70c87db046.tar.xz wireguard-linux-36ec52ea038b18a53e198116ef7d7e70c87db046.zip |
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: 16d055656814 ("udf: Discard preallocation before extending file with a hole")
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c')
0 files changed, 0 insertions, 0 deletions