]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Dec 2018 16:23:05 +0000 (17:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Dec 2018 16:23:05 +0000 (17:23 +0100)
added patches:
f2fs-fix-a-panic-caused-by-null-flush_cmd_control.patch

queue-4.4/f2fs-fix-a-panic-caused-by-null-flush_cmd_control.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/f2fs-fix-a-panic-caused-by-null-flush_cmd_control.patch b/queue-4.4/f2fs-fix-a-panic-caused-by-null-flush_cmd_control.patch
new file mode 100644 (file)
index 0000000..2a76e26
--- /dev/null
@@ -0,0 +1,48 @@
+From d4fdf8ba0e5808ba9ad6b44337783bd9935e0982 Mon Sep 17 00:00:00 2001
+From: Yunlei He <heyunlei@huawei.com>
+Date: Thu, 1 Jun 2017 16:43:51 +0800
+Subject: f2fs: fix a panic caused by NULL flush_cmd_control
+
+From: Yunlei He <heyunlei@huawei.com>
+
+commit d4fdf8ba0e5808ba9ad6b44337783bd9935e0982 upstream.
+
+Mount fs with option noflush_merge, boot failed for illegal address
+fcc in function f2fs_issue_flush:
+
+        if (!test_opt(sbi, FLUSH_MERGE)) {
+                ret = submit_flush_wait(sbi);
+                atomic_inc(&fcc->issued_flush);   ->  Here, fcc illegal
+                return ret;
+        }
+
+Signed-off-by: Yunlei He <heyunlei@huawei.com>
+Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
+[bwh: Backported to 4.9: adjust context]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/f2fs/segment.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/fs/f2fs/segment.c
++++ b/fs/f2fs/segment.c
+@@ -398,6 +398,9 @@ int create_flush_cmd_control(struct f2fs
+       init_waitqueue_head(&fcc->flush_wait_queue);
+       init_llist_head(&fcc->issue_list);
+       SM_I(sbi)->cmd_control_info = fcc;
++      if (!test_opt(sbi, FLUSH_MERGE))
++              return err;
++
+       fcc->f2fs_issue_flush = kthread_run(issue_flush_thread, sbi,
+                               "f2fs_flush-%u:%u", MAJOR(dev), MINOR(dev));
+       if (IS_ERR(fcc->f2fs_issue_flush)) {
+@@ -2316,7 +2319,7 @@ int build_segment_manager(struct f2fs_sb
+       INIT_LIST_HEAD(&sm_info->sit_entry_set);
+-      if (test_opt(sbi, FLUSH_MERGE) && !f2fs_readonly(sbi->sb)) {
++      if (!f2fs_readonly(sbi->sb)) {
+               err = create_flush_cmd_control(sbi);
+               if (err)
+                       return err;
index 19c0fe845d2d65cad1bfae40244f560ca1d3fd20..678815cf94d4e5368634da4f6e8bdb73514cd0ea 100644 (file)
@@ -12,3 +12,4 @@ tracing-fix-memory-leak-in-set_trigger_filter.patch
 tracing-fix-memory-leak-of-instance-function-hash-filters.patch
 powerpc-msi-fix-null-pointer-access-in-teardown-code.patch
 revert-drm-rockchip-allow-driver-to-be-shutdown-on-reboot-kexec.patch
+f2fs-fix-a-panic-caused-by-null-flush_cmd_control.patch