Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

udf: Fix crash on IO error during truncate

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.

CC: stable@vger.kernel.org
Reported-by: jean-luc malet <jeanluc.malet@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>

Jan Kara d3ca4651 9e98c678

+3
+3
fs/udf/truncate.c
··· 260 260 epos.block = eloc; 261 261 epos.bh = udf_tread(sb, 262 262 udf_get_lb_pblock(sb, &eloc, 0)); 263 + /* Error reading indirect block? */ 264 + if (!epos.bh) 265 + return; 263 266 if (elen) 264 267 indirect_ext_len = 265 268 (elen + sb->s_blocksize - 1) >>