lkml.org 
[lkml]   [2012]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] hostfs: fix a not needed double check
Il 20/10/2012 12:02, Marco Stornelli ha scritto:
> With the commit 3be2be0a32c18b0fd6d623cda63174a332ca0de1 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>
> ---
> fs/hostfs/hostfs_kern.c | 9 +--------
> 1 files changed, 1 insertions(+), 8 deletions(-)
>
> diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
> index 457addc..c9d5254 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);
>

Any feedback for this patch?

Marco


\
 
 \ /
  Last update: 2012-11-18 10:21    [W:0.094 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site