diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 7b80d543b89e71c41764b54a5d6eee59992c712c..2c09723220091f7520b5a9c04622e1d788b9b1c4 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -272,7 +272,6 @@ const struct file_operations ext4_file_operations = { }; const struct inode_operations ext4_file_inode_operations = { - .truncate = ext4_truncate, .setattr = ext4_setattr, .getattr = ext4_getattr, #ifdef CONFIG_EXT4_FS_XATTR diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 65576c02c6f5c280704b20625b1572d197dd4719..50d0e9c645845a4001e4da390318fa0c9e6b45b9 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3511,7 +3511,7 @@ static ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb, loff_t end = offset + iov_length(iov, nr_segs); if (end > isize) - vmtruncate(inode, isize); + ext4_truncate_failed_write(inode); } } if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) @@ -4407,8 +4407,6 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode, int ext4_can_truncate(struct inode *inode) { - if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) - return 0; if (S_ISREG(inode->i_mode)) return 1; if (S_ISDIR(inode->i_mode))