f2fs: recover fallocated space
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 5 Jun 2014 17:12:59 +0000 (02:12 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 6 Jun 2014 18:18:35 +0000 (03:18 +0900)
If a fallocated file is fsynced, we should recover the i_size after sudden
power cut.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index d97e5c458f360bab7e531c771ba7e60026650dfa..78110dab56817a3ef4017d40924cf26906112f7f 100644 (file)
@@ -682,6 +682,7 @@ static int expand_inode_data(struct inode *inode, loff_t offset,
                i_size_read(inode) < new_size) {
                i_size_write(inode, new_size);
                mark_inode_dirty(inode);
+               f2fs_write_inode(inode, NULL);
        }
 
        return ret;