Commit 6a502107 authored by Jan Kara's avatar Jan Kara Committed by Greg Kroah-Hartman

udf: Fix crash on IO error during truncate

commit d3ca4651d05c0ff7259d087d8c949bcf3e14fb46 upstream.

When truncate(2) hits IO error when reading indirect extent block the
code just bugs with:

kernel BUG at linux-4.15.0/fs/udf/truncate.c:249!

Fix the problem by bailing out cleanly in case of IO error.

Reported-by: default avatarjean-luc malet <>
Signed-off-by: default avatarJan Kara <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 2e5522ad
......@@ -260,6 +260,9 @@ void udf_truncate_extents(struct inode *inode)
epos.block = eloc; = udf_tread(sb,
udf_get_lb_pblock(sb, &eloc, 0));
/* Error reading indirect block? */
if (!
if (elen)
indirect_ext_len =
(elen + sb->s_blocksize - 1) >>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment