udf: Move setting of i_lenExtents into udf_do_extend_file()
authorJan Kara <jack@suse.cz>
Wed, 21 Dec 2022 11:18:23 +0000 (12:18 +0100)
committerJan Kara <jack@suse.cz>
Mon, 9 Jan 2023 09:39:53 +0000 (10:39 +0100)
commite57191a8d40086537d505241a8ee49d8b62ce1d6
treefbef25e7c56b0706111fec1ec56b7532abc6a984
parent0aba4860b0d0216a1a300484ff536171894d49d8
udf: Move setting of i_lenExtents into udf_do_extend_file()

When expanding file for a write into a hole, we were not updating total
length of inode's extents properly. Move the update of i_lenExtents into
udf_do_extend_file() so that both expanding of file by truncate and
expanding of file by writing beyond EOF properly update the length of
extents. As a bonus, we also correctly update the length of extents when
only part of extents can be written.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/inode.c