Skip to content

Commit

Permalink
hostfs: fix a not needed double check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marco Stornelli authored and Richard Weinberger committed Mar 11, 2013
1 parent f6161aa commit bc07732
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions fs/hostfs/hostfs_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,15 +845,8 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr)
return err;

if ((attr->ia_valid & ATTR_SIZE) &&
attr->ia_size != i_size_read(inode)) {
int error;

error = inode_newsize_ok(inode, attr->ia_size);
if (error)
return error;

attr->ia_size != i_size_read(inode))
truncate_setsize(inode, attr->ia_size);
}

setattr_copy(inode, attr);
mark_inode_dirty(inode);
Expand Down

0 comments on commit bc07732

Please sign in to comment.