]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-3.18/udf-fix-crash-on-io-error-during-truncate.patch
fix up powerpc patch headers, I messed up.
[thirdparty/kernel/stable-queue.git] / queue-3.18 / udf-fix-crash-on-io-error-during-truncate.patch
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
5
6 From: Jan Kara <jack@suse.cz>
7
8 commit d3ca4651d05c0ff7259d087d8c949bcf3e14fb46 upstream.
9
10 When truncate(2) hits IO error when reading indirect extent block the
11 code just bugs with:
12
13 kernel BUG at linux-4.15.0/fs/udf/truncate.c:249!
14 ...
15
16 Fix the problem by bailing out cleanly in case of IO error.
17
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>
22
23 ---
24 fs/udf/truncate.c | 3 +++
25 1 file changed, 3 insertions(+)
26
27 --- a/fs/udf/truncate.c
28 +++ b/fs/udf/truncate.c
29 @@ -261,6 +261,9 @@ void udf_truncate_extents(struct inode *
30 epos.block = eloc;
31 epos.bh = udf_tread(sb,
32 udf_get_lb_pblock(sb, &eloc, 0));
33 + /* Error reading indirect block? */
34 + if (!epos.bh)
35 + return;
36 if (elen)
37 indirect_ext_len =
38 (elen + sb->s_blocksize - 1) >>