diff options
author | Theodore Ts'o <tytso@mit.edu> | 2016-11-13 22:02:28 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-11-13 22:02:28 -0500 |
commit | d0abb36db44faaf8f8aa148ca206fe2404042dec (patch) | |
tree | ba2df0fb5b53f82725400269e6de78e0fd0042a1 /fs/ext4/inode.c | |
parent | 2c98eb5ea249767bbc11cf4e70e91d5b0458ed13 (diff) | |
download | op-kernel-dev-d0abb36db44faaf8f8aa148ca206fe2404042dec.zip op-kernel-dev-d0abb36db44faaf8f8aa148ca206fe2404042dec.tar.gz |
ext4: allow ext4_ext_truncate() to return an error
Return errors to the caller instead of declaring the file system
corrupted.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 5851530..79f46f4 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4173,11 +4173,13 @@ int ext4_truncate(struct inode *inode) ext4_discard_preallocations(inode); if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) - ext4_ext_truncate(handle, inode); + err = ext4_ext_truncate(handle, inode); else ext4_ind_truncate(handle, inode); up_write(&ei->i_data_sem); + if (err) + goto out_stop; if (IS_SYNC(inode)) ext4_handle_sync(handle); |