diff options
author | Theodore Ts'o <tytso@mit.edu> | 2016-11-14 06:02:26 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-11-14 06:02:26 +0300 |
commit | 2c98eb5ea249767bbc11cf4e70e91d5b0458ed13 (patch) | |
tree | de83b9e69d357898b2b737257b33dfc1ace75ba8 /fs/ext4/ioctl.c | |
parent | 6da22013bb7907b33c87968c25034b409a6161a2 (diff) | |
download | linux-2c98eb5ea249767bbc11cf4e70e91d5b0458ed13.tar.xz |
ext4: allow ext4_truncate() to return an error
This allows us to properly propagate errors back up to
ext4_truncate()'s callers. This also means we no longer have to
silently ignore some errors (e.g., when trying to add the inode to the
orphan inode list).
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r-- | fs/ext4/ioctl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index bf5ae8ebbc97..99862a3726fc 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -248,8 +248,11 @@ static int ext4_ioctl_setflags(struct inode *inode, err = -EOPNOTSUPP; goto flags_out; } - } else if (oldflags & EXT4_EOFBLOCKS_FL) - ext4_truncate(inode); + } else if (oldflags & EXT4_EOFBLOCKS_FL) { + err = ext4_truncate(inode); + if (err) + goto flags_out; + } handle = ext4_journal_start(inode, EXT4_HT_INODE, 1); if (IS_ERR(handle)) { |