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:
Zach Brown
2016-03-26 22:28:45 -07:00
parent 059212d50e
commit eff3d78cb1

View File

@@ -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);