hostfs: fix a not needed double check
With the commit 3be2be0a32
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>
This commit is contained in:
parent
f6161aa153
commit
bc077320f8
@ -845,15 +845,8 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr)
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
if ((attr->ia_valid & ATTR_SIZE) &&
|
if ((attr->ia_valid & ATTR_SIZE) &&
|
||||||
attr->ia_size != i_size_read(inode)) {
|
attr->ia_size != i_size_read(inode))
|
||||||
int error;
|
|
||||||
|
|
||||||
error = inode_newsize_ok(inode, attr->ia_size);
|
|
||||||
if (error)
|
|
||||||
return error;
|
|
||||||
|
|
||||||
truncate_setsize(inode, attr->ia_size);
|
truncate_setsize(inode, attr->ia_size);
|
||||||
}
|
|
||||||
|
|
||||||
setattr_copy(inode, attr);
|
setattr_copy(inode, attr);
|
||||||
mark_inode_dirty(inode);
|
mark_inode_dirty(inode);
|
||||||
|
Loading…
Reference in New Issue
Block a user