]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jan 2019 08:18:28 +0000 (09:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jan 2019 08:18:28 +0000 (09:18 +0100)
added patches:
revert-f2fs-do-not-recover-from-previous-remained-wrong-dnodes.patch

queue-4.9/revert-f2fs-do-not-recover-from-previous-remained-wrong-dnodes.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/revert-f2fs-do-not-recover-from-previous-remained-wrong-dnodes.patch b/queue-4.9/revert-f2fs-do-not-recover-from-previous-remained-wrong-dnodes.patch
new file mode 100644 (file)
index 0000000..59eb29e
--- /dev/null
@@ -0,0 +1,75 @@
+From d47b8715953ad0cf82bb0a9d30d7b11d83bc9c11 Mon Sep 17 00:00:00 2001
+From: Chao Yu <yuchao0@huawei.com>
+Date: Sat, 5 Nov 2016 11:12:40 +0800
+Subject: Revert "f2fs: do not recover from previous remained wrong dnodes"
+
+From: Chao Yu <yuchao0@huawei.com>
+
+commit d47b8715953ad0cf82bb0a9d30d7b11d83bc9c11 upstream.
+
+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>
+Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/f2fs/recovery.c |   31 +------------------------------
+ 1 file changed, 1 insertion(+), 30 deletions(-)
+
+--- a/fs/f2fs/recovery.c
++++ b/fs/f2fs/recovery.c
+@@ -196,32 +196,6 @@ static void recover_inode(struct inode *
+                       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
+                       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)
index 6b8f573d92142deb870239598fb48c2c440ada72..3b4884e13c8f4caa91a7aac84b454c2806a8cd61 100644 (file)
@@ -3,3 +3,4 @@ tty-hold-tty_ldisc_lock-during-tty_reopen.patch
 tty-simplify-tty-count-math-in-tty_reopen.patch
 tty-don-t-hold-ldisc-lock-in-tty_reopen-if-ldisc-present.patch
 can-gw-ensure-dlc-boundaries-after-can-frame-modification.patch
+revert-f2fs-do-not-recover-from-previous-remained-wrong-dnodes.patch