]> git.baikalelectronics.ru Git - kernel.git/commit
udf: Fix incorrect final NOT_ALLOCATED (hole) extent length
authorSteven J. Magnani <steve.magnani@digidescorp.com>
Mon, 1 Jul 2019 02:39:35 +0000 (21:39 -0500)
committerJan Kara <jack@suse.cz>
Wed, 10 Jul 2019 08:11:24 +0000 (10:11 +0200)
commit775f5b35de4cd945506a3a0f068ebee860cf62d1
tree281cbca1317d602a0d7cbabf37b7e492cc5be3ec
parent8bbf813e372556e84b7564a3abc49bbaab34354f
udf: Fix incorrect final NOT_ALLOCATED (hole) extent length

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: 5857c85d437f ("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>
fs/udf/inode.c