udf: Fix crash on IO error during truncate
authorJan Kara <jack@suse.cz>
Mon, 11 Mar 2019 14:04:18 +0000 (15:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Mar 2019 05:13:52 +0000 (14:13 +0900)
commit6a502107f716ba502d681d23afa779a28b83ca0f
tree5761fb1f51e0822620b8cb8a0a5bfcc361bf59ce
parent2e5522ad5c1cca8848525721643f824cc651ca16
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.

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