summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-06-13 13:05:55 +0900
committerJaegeuk Kim <jaegeuk@kernel.org>2014-06-23 10:05:08 +0900
commitead432756ab2c76b1f1de742a1c8a06992cb98eb (patch)
treee56de605c8662d8c9efc48520f4a4374ca14ed98 /fs
parentccfb30001f37ace4690a74c27b4812cf054e123a (diff)
downloadlinux-ead432756ab2c76b1f1de742a1c8a06992cb98eb.tar.gz
linux-ead432756ab2c76b1f1de742a1c8a06992cb98eb.tar.bz2
linux-ead432756ab2c76b1f1de742a1c8a06992cb98eb.zip
f2fs: recover fallocated data and its i_size together
This patch arranges the f2fs_locks to cover the fallocated data and its i_size. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/file.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index c58e33075719..f6c4bdaaae86 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -659,13 +659,13 @@ static int expand_inode_data(struct inode *inode, loff_t offset,
off_start = offset & (PAGE_CACHE_SIZE - 1);
off_end = (offset + len) & (PAGE_CACHE_SIZE - 1);
+ f2fs_lock_op(sbi);
+
for (index = pg_start; index <= pg_end; index++) {
struct dnode_of_data dn;
- f2fs_lock_op(sbi);
set_new_dnode(&dn, inode, NULL, NULL, 0);
ret = f2fs_reserve_block(&dn, index);
- f2fs_unlock_op(sbi);
if (ret)
break;
@@ -683,8 +683,9 @@ 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);
+ update_inode_page(inode);
}
+ f2fs_unlock_op(sbi);
return ret;
}