linux-brain/fs/udf
Steven J. Magnani 541cb89c75 udf: Fix incorrect final NOT_ALLOCATED (hole) extent length
commit fa33cdbf3e upstream.

In some cases, using the 'truncate' command to extend a UDF file results
in a mismatch between the length of the file's extents (specifically, due
to incorrect length of the final NOT_ALLOCATED extent) and the information
(file) length. The discrepancy can prevent other operating systems
(i.e., Windows 10) from opening the file.

Two particular errors have been observed when extending a file:

1. The final extent is larger than it should be, having been rounded up
   to a multiple of the block size.

B. The final extent is not shorter than it should be, due to not having
   been updated when the file's information length was increased.

[JK: simplified udf_do_extend_final_block(), fixed up some types]

Fixes: 2c948b3f86 ("udf: Avoid IO in udf_clear_inode")
CC: stable@vger.kernel.org
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Link: https://lore.kernel.org/r/1561948775-5878-1-git-send-email-steve@digidescorp.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-21 09:04:30 +02:00
..
balloc.c udf: Factor out code for creating indirect extent 2015-12-23 18:04:52 +01:00
dir.c block,fs: untangle fs.h and blk_types.h 2016-11-01 09:43:26 -06:00
directory.c udf: Detect incorrect directory size 2018-07-03 11:25:03 +02:00
ecma_167.h udf: use __packed instead of __attribute__ ((packed)) 2017-01-10 11:29:11 +01:00
file.c udf: Use i_size_read() in udf_adinicb_writepage() 2017-06-14 11:21:01 +02:00
ialloc.c fs: Replace current_fs_time() with current_time() 2016-09-27 21:06:22 -04:00
inode.c udf: Fix incorrect final NOT_ALLOCATED (hole) extent length 2019-07-21 09:04:30 +02:00
Kconfig udf: Update Kconfig description 2015-01-05 11:04:37 +01:00
lowlevel.c udf: atomically read inode size 2017-01-10 11:57:34 +01:00
Makefile switch udf to simple_fsync() 2009-06-11 21:36:13 -04:00
misc.c udf: remove empty condition 2017-01-10 11:37:31 +01:00
namei.c do d_instantiate/unlock_new_inode combinations safely 2018-05-30 07:51:47 +02:00
osta_udf.h udf: use __packed instead of __attribute__ ((packed)) 2017-01-10 11:29:11 +01:00
partition.c udf: Use correct partition reference number for metadata 2016-05-19 13:00:35 +02:00
super.c udf: Allow mounting volumes with incorrect identification strings 2018-12-08 13:03:39 +01:00
symlink.c statx: Add a system call to make enhanced file info available 2017-03-02 20:51:15 -05:00
truncate.c udf: Fix crash on IO error during truncate 2019-03-27 14:13:52 +09:00
udf_i.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
udf_sb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
udfdecl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +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 udf_disk_stamp_to_time() to use mktime64() 2017-06-14 11:21:02 +02:00
unicode.c udf: Allow mounting volumes with incorrect identification strings 2018-12-08 13:03:39 +01:00