summaryrefslogtreecommitdiff
path: root/fs/logfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/logfs/file.c')
-rw-r--r--fs/logfs/file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/logfs/file.c b/fs/logfs/file.c
index 23b4d03bbd26..4dd0f7c06e39 100644
--- a/fs/logfs/file.c
+++ b/fs/logfs/file.c
@@ -232,16 +232,16 @@ static int logfs_setattr(struct dentry *dentry, struct iattr *attr)
struct inode *inode = dentry->d_inode;
int err = 0;
+ err = inode_change_ok(inode, attr);
+ if (err)
+ return err;
+
if (attr->ia_valid & ATTR_SIZE) {
err = logfs_truncate(inode, attr->ia_size);
if (err)
return err;
}
- err = inode_change_ok(inode, attr);
- if (err)
- return err;
-
setattr_copy(inode, attr);
mark_inode_dirty(inode);
return 0;