From 604e44f896101cc6f68e364535490417616d224e Mon Sep 17 00:00:00 2001 From: Marco Stornelli Date: Sat, 20 Oct 2012 12:02:59 +0200 Subject: [PATCH] hostfs: fix a not needed double check With the commit 56b74318c5c33788a666d35cc275b446ab5c5b1f 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 Signed-off-by: Richard Weinberger --- fs/hostfs/hostfs_kern.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index fbabb906066fa..178b90c229b52 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -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); -- 2.39.5