Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc077320 authored by Marco Stornelli's avatar Marco Stornelli Committed by Richard Weinberger
Browse files

hostfs: fix a not needed double check



With the commit 3be2be0a 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: default avatarMarco Stornelli <marco.stornelli@gmail.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent f6161aa1
Loading
Loading
Loading
Loading
+1 −8
Original line number Original line Diff line number Diff line
@@ -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);