1 From d3ca4651d05c0ff7259d087d8c949bcf3e14fb46 Mon Sep 17 00:00:00 2001
2 From: Jan Kara <jack@suse.cz>
3 Date: Mon, 11 Mar 2019 15:04:18 +0100
4 Subject: udf: Fix crash on IO error during truncate
6 From: Jan Kara <jack@suse.cz>
8 commit d3ca4651d05c0ff7259d087d8c949bcf3e14fb46 upstream.
10 When truncate(2) hits IO error when reading indirect extent block the
13 kernel BUG at linux-4.15.0/fs/udf/truncate.c:249!
16 Fix the problem by bailing out cleanly in case of IO error.
18 CC: stable@vger.kernel.org
19 Reported-by: jean-luc malet <jeanluc.malet@gmail.com>
20 Signed-off-by: Jan Kara <jack@suse.cz>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 fs/udf/truncate.c | 3 +++
25 1 file changed, 3 insertions(+)
27 --- a/fs/udf/truncate.c
28 +++ b/fs/udf/truncate.c
29 @@ -261,6 +261,9 @@ void udf_truncate_extents(struct inode *
31 epos.bh = udf_tread(sb,
32 udf_get_lb_pblock(sb, &eloc, 0));
33 + /* Error reading indirect block? */
38 (elen + sb->s_blocksize - 1) >>