android_kernel_samsung_a7y1.../fs/udf
Steven J. Magnani c4ba3f2f09 udf: Fix incorrect final NOT_ALLOCATED (hole) extent length
commit fa33cdbf3eceb0206a4f844fe91aeebcf6ff2b7a 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: 2c948b3f86e5 ("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>
2020-04-06 19:26:24 +02:00
..
balloc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dir.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
directory.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ecma_167.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
file.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ialloc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inode.c udf: Fix incorrect final NOT_ALLOCATED (hole) extent length 2020-04-06 19:26:24 +02:00
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lowlevel.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
misc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
namei.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
osta_udf.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
partition.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
super.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
symlink.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
truncate.c udf: Fix crash on IO error during truncate 2020-04-06 10:58:12 +02:00
udf_i.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udf_sb.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udfdecl.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udfend.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udftime.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
unicode.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30