aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ioctl.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2016-11-13 22:02:26 -0500
committerTheodore Ts'o <tytso@mit.edu>2016-11-13 22:02:26 -0500
commit2c98eb5ea249767bbc11cf4e70e91d5b0458ed13 (patch)
treede83b9e69d357898b2b737257b33dfc1ace75ba8 /fs/ext4/ioctl.c
parent6da22013bb7907b33c87968c25034b409a6161a2 (diff)
downloadlinux-2c98eb5ea249767bbc11cf4e70e91d5b0458ed13.tar.gz
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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index bf5ae8ebbc9788..99862a3726fc08 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)) {