Revert "f2fs: do not recover from previous remained wrong dnodes"
authorChao Yu <yuchao0@huawei.com>
Sat, 5 Nov 2016 03:12:40 +0000 (11:12 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 23 Nov 2016 20:11:30 +0000 (12:11 -0800)
i_times of inode will be set with current system time which can be
configured through 'date', so it's not safe to judge dnode block as
garbage data or unchanged inode depend on i_times.

Now, we have used enhanced 'cp_ver + cp' crc method to verify valid
dnode block, so I expect recoverying invalid dnode is almost not
possible.

This reverts commit 807b1e1c8e08452948495b1a9985ab46d329e5c2.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/recovery.c

index d2ba4da08ec398fc9d4ffab0fc73b69671b125f9..62523b2175714c09eff2c5fd8bd97f960f78181a 100644 (file)
@@ -196,32 +196,6 @@ static void recover_inode(struct inode *inode, struct page *page)
                        ino_of_node(page), name);
 }
 
-static bool is_same_inode(struct inode *inode, struct page *ipage)
-{
-       struct f2fs_inode *ri = F2FS_INODE(ipage);
-       struct timespec disk;
-
-       if (!IS_INODE(ipage))
-               return true;
-
-       disk.tv_sec = le64_to_cpu(ri->i_ctime);
-       disk.tv_nsec = le32_to_cpu(ri->i_ctime_nsec);
-       if (timespec_compare(&inode->i_ctime, &disk) > 0)
-               return false;
-
-       disk.tv_sec = le64_to_cpu(ri->i_atime);
-       disk.tv_nsec = le32_to_cpu(ri->i_atime_nsec);
-       if (timespec_compare(&inode->i_atime, &disk) > 0)
-               return false;
-
-       disk.tv_sec = le64_to_cpu(ri->i_mtime);
-       disk.tv_nsec = le32_to_cpu(ri->i_mtime_nsec);
-       if (timespec_compare(&inode->i_mtime, &disk) > 0)
-               return false;
-
-       return true;
-}
-
 static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head)
 {
        struct curseg_info *curseg;
@@ -248,10 +222,7 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head)
                        goto next;
 
                entry = get_fsync_inode(head, ino_of_node(page));
-               if (entry) {
-                       if (!is_same_inode(entry->inode, page))
-                               goto next;
-               } else {
+               if (!entry) {
                        if (IS_INODE(page) && is_dent_dnode(page)) {
                                err = recover_inode_page(sbi, page);
                                if (err)