udf: Fix preallocation discarding at indirect extent boundary
authorJan Kara <jack@suse.cz>
Wed, 7 Dec 2022 16:25:10 +0000 (17:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 11:07:11 +0000 (12:07 +0100)
commitc8b6fa4511a7900db9fb0353b630d4d2ed1ba99c
tree86ba81cbaba385997ddf6480807c7afd3bc81d19
parenta58ae14b9a9b644691528c3acc29acf9e0118f34
udf: Fix preallocation discarding at indirect extent boundary

commit cfe4c1b25dd6d2f056afc00b7c98bcb3dd0b1fc3 upstream.

When preallocation extent is the first one in the extent block, the
code would corrupt extent tree header instead. Fix the problem and use
udf_delete_aext() for deleting extent to avoid some code duplication.

CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/udf/truncate.c