diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-04-15 09:43:17 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-04-26 14:24:59 -0700 |
commit | 608514deba38c8611ad330d6a3c8e2b9a1f68e4b (patch) | |
tree | 7ad9dc7a46b492be6e0a7ed5f2d22f57bd7676eb /fs/f2fs/recovery.c | |
parent | c267ec1526da2d3b12c80a89ebd8eb9b6a01d636 (diff) | |
download | linux-stable-608514deba38c8611ad330d6a3c8e2b9a1f68e4b.tar.gz linux-stable-608514deba38c8611ad330d6a3c8e2b9a1f68e4b.tar.bz2 linux-stable-608514deba38c8611ad330d6a3c8e2b9a1f68e4b.zip |
f2fs: set fsync mark only for the last dnode
In order to give atomic writes, we should consider power failure during
sync_node_pages in fsync.
So, this patch marks fsync flag only in the last dnode block.
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/recovery.c')
-rw-r--r-- | fs/f2fs/recovery.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 2c87c12b6f1c..a646d3ba3b25 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -257,11 +257,8 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head) } entry->blkaddr = blkaddr; - if (IS_INODE(page)) { - entry->last_inode = blkaddr; - if (is_dent_dnode(page)) - entry->last_dentry = blkaddr; - } + if (IS_INODE(page) && is_dent_dnode(page)) + entry->last_dentry = blkaddr; next: /* check next segment */ blkaddr = next_blkaddr_of_node(page); @@ -521,7 +518,7 @@ static int recover_data(struct f2fs_sb_info *sbi, struct list_head *head) * In this case, we can lose the latest inode(x). * So, call recover_inode for the inode update. */ - if (entry->last_inode == blkaddr) + if (IS_INODE(page)) recover_inode(entry->inode, page); if (entry->last_dentry == blkaddr) { err = recover_dentry(entry->inode, page); |