mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-03 10:55:20 +00:00
scoutfs: update inode when write changes i_size
Extended file data wasn't persistent because we weren't writing out the inode with the i_size update that covered the newly written data. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -197,8 +197,12 @@ static int scoutfs_write_end(struct file *file, struct address_space *mapping,
|
||||
if (copied < len)
|
||||
zero_user_segment(page, off + copied, len);
|
||||
|
||||
if (pos + copied > inode->i_size)
|
||||
if (pos + copied > inode->i_size) {
|
||||
i_size_write(inode, pos + copied);
|
||||
/* XXX need to think about pinning and enospc */
|
||||
if (!scoutfs_dirty_inode_item(inode))
|
||||
scoutfs_update_inode_item(inode);
|
||||
}
|
||||
|
||||
if (!PageUptodate(page))
|
||||
SetPageUptodate(page);
|
||||
|
||||
Reference in New Issue
Block a user