udf: Propagate errors from udf_truncate_extents()

Make udf_truncate_extents() properly propagate errors to its callers and
let udf_setsize() handle the error properly as well. This lets userspace
know in case there's some error when truncating blocks.

Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
Jan Kara
2019-03-11 15:27:02 +01:00
parent d3ca4651d0
commit 2b42be5eb2
3 changed files with 8 additions and 5 deletions

View File

@@ -1242,8 +1242,10 @@ set_size:
truncate_setsize(inode, newsize);
down_write(&iinfo->i_data_sem);
udf_clear_extent_cache(inode);
udf_truncate_extents(inode);
err = udf_truncate_extents(inode);
up_write(&iinfo->i_data_sem);
if (err)
return err;
}
update_time:
inode->i_mtime = inode->i_ctime = current_time(inode);