hostfs: fix a not needed double check
Subsystems (2)
PATCH 1/1 hostfs: fix a not needed double check
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.
--- fs/hostfs/hostfs_kern.c | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-)
fs/hostfs/hostfs_kern.c +1 -8
@@ -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);
Signature · 1 line
1.7.3.4
Il 20/10/2012 12:02, Marco Stornelli ha scritto:
Quoted 21 lines
With the commit
3be2be0a32c18b0fd6d623cda63174a332ca0de1we removed vmtruncate, but actaully there is no need to callinode_newsize_ok()because the checks are already done ininode_change_ok()at the begin of the function.Signed-off-by Marco Stornelli <[email protected]>--- fs/hostfs/hostfs_kern.c | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-)fs/hostfs/hostfs_kern.c +0
-3@@ -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; -
fs/hostfs/hostfs_kern.c int hostfs_setattr(struct dentry *dentry, struct iattr *attr) · line 852
Quoted 10 lines
fs/hostfs/hostfs_kern.c +1
-5- 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
Il 18/11/2012 09:59, Marco Stornelli ha scritto:
Quoted 8 lines
Il 20/10/2012 12:02, Marco Stornelli ha scritto:
Quoted 7 lines
With the commit
3be2be0a32c18b0fd6d623cda63174a332ca0de1we removed vmtruncate,
but actaully there is no need to callinode_newsize_ok()because the checks are
already done ininode_change_ok()at the begin of the function.Signed-off-by Marco Stornelli <[email protected]>
I didn't receive any feedback from Weinberger, could you consider this patch for next -rc?
Thanks.
Marco
Richard Weinberger
maintainerAm Sat, 24 Nov 2012 10:02:32 +0100
schrieb Marco Stornelli <[email protected]>:
Quoted 8 lines
Il 18/11/2012 09:59, Marco Stornelli ha scritto:
Quoted 7 lines
Il 20/10/2012 12:02, Marco Stornelli ha scritto:
Quoted 6 lines
With the commit
3be2be0a32c18b0fd6d623cda63174a332ca0de1we removed vmtruncate,
but actaully there is no need to callinode_newsize_ok()because the checks are
already done ininode_change_ok()at the begin of the function.
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Signed-off-by Marco Stornelli <[email protected]>I didn't receive any feedback from Weinberger, could you consider this patch for next -rc?
Whoops. Sorry. -ENOMAL.
I can carry this patch through uml.git
Thanks,
//richard
Il 24/11/2012 10:12, Richard Weinberger ha scritto:
Quoted 16 lines
Am Sat, 24 Nov 2012 10:02:32 +0100
schrieb Marco Stornelli <[email protected]>:Quoted 8 lines
Il 18/11/2012 09:59, Marco Stornelli ha scritto:
Quoted 7 lines
Il 20/10/2012 12:02, Marco Stornelli ha scritto:
Quoted 6 lines
With the commit
3be2be0a32c18b0fd6d623cda63174a332ca0de1we removed vmtruncate,
but actaully there is no need to callinode_newsize_ok()because the checks are
already done ininode_change_ok()at the begin of the function.Quoted 4 lines
Quoted 1 line
Quoted 1 line
Signed-off-by Marco Stornelli <[email protected]>I didn't receive any feedback from Weinberger, could you consider this patch for next -rc?
Quoted 7 lines
Whoops. Sorry.
-ENOMAL.I can carry this patch through uml.git
Thanks,
//richard
No problem, thanks :)
Marco