Skip to content

Commit

Permalink
f2fs: fix a missing size change in f2fs_setattr
Browse files Browse the repository at this point in the history
This patch fix a missing size change in f2fs_setattr

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Yunlei He authored and Jaegeuk Kim committed Dec 12, 2016
1 parent 5eba8c5 commit c0ed440
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = d_inode(dentry);
int err;
bool size_changed = false;

err = setattr_prepare(dentry, attr);
if (err)
Expand Down Expand Up @@ -707,6 +708,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
}
inode->i_mtime = inode->i_ctime = current_time(inode);
}

size_changed = true;
}

__setattr_copy(inode, attr);
Expand All @@ -719,8 +722,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
}
}

/* update attributes only */
f2fs_mark_inode_dirty_sync(inode, false);
/* file size may changed here */
f2fs_mark_inode_dirty_sync(inode, size_changed);

/* inode change will produce dirty node pages flushed by checkpoint */
f2fs_balance_fs(F2FS_I_SB(inode), true);
Expand Down

0 comments on commit c0ed440

Please sign in to comment.