Skip to content

Commit bc07732

Browse files
Marco Stornellirichardweinberger
authored andcommitted
hostfs: fix a not needed double check
With the commit 3be2be0 we removed vmtruncate, but actaully there is no need to call inode_newsize_ok() because the checks are already done in inode_change_ok() at the begin of the function. Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent f6161aa commit bc07732

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

‎fs/hostfs/hostfs_kern.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -845,15 +845,8 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr)
845845
return err;
846846

847847
if ((attr->ia_valid & ATTR_SIZE) &&
848-
attr->ia_size != i_size_read(inode)) {
849-
int error;
850-
851-
error = inode_newsize_ok(inode, attr->ia_size);
852-
if (error)
853-
return error;
854-
848+
attr->ia_size != i_size_read(inode))
855849
truncate_setsize(inode, attr->ia_size);
856-
}
857850

858851
setattr_copy(inode, attr);
859852
mark_inode_dirty(inode);

0 commit comments

Comments
 (0)