diff options
author | Theodore Ts'o <tytso@mit.edu> | 2016-11-14 04:02:26 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-11-14 04:02:26 +0100 |
commit | 2c98eb5ea249767bbc11cf4e70e91d5b0458ed13 (patch) | |
tree | de83b9e69d357898b2b737257b33dfc1ace75ba8 /fs/ext4/ioctl.c | |
parent | Merge branch 'fscrypt' into origin (diff) | |
download | linux-2c98eb5ea249767bbc11cf4e70e91d5b0458ed13.tar.xz linux-2c98eb5ea249767bbc11cf4e70e91d5b0458ed13.zip |
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)) { |