]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.3-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Oct 2019 19:52:35 +0000 (15:52 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Oct 2019 19:52:35 +0000 (15:52 -0400)
added patches:
nvme-pci-set-the-prp2-correctly-when-using-more-than-4k-page.patch
ocfs2-fix-panic-due-to-ocfs2_wq-is-null.patch

queue-5.3/nvme-pci-set-the-prp2-correctly-when-using-more-than-4k-page.patch [new file with mode: 0644]
queue-5.3/ocfs2-fix-panic-due-to-ocfs2_wq-is-null.patch [new file with mode: 0644]
queue-5.3/series

diff --git a/queue-5.3/nvme-pci-set-the-prp2-correctly-when-using-more-than-4k-page.patch b/queue-5.3/nvme-pci-set-the-prp2-correctly-when-using-more-than-4k-page.patch
new file mode 100644 (file)
index 0000000..f8006fb
--- /dev/null
@@ -0,0 +1,38 @@
+From a4f40484e7f1dff56bb9f286cc59ffa36e0259eb Mon Sep 17 00:00:00 2001
+From: Kevin Hao <haokexin@gmail.com>
+Date: Fri, 18 Oct 2019 10:53:14 +0800
+Subject: nvme-pci: Set the prp2 correctly when using more than 4k page
+
+From: Kevin Hao <haokexin@gmail.com>
+
+commit a4f40484e7f1dff56bb9f286cc59ffa36e0259eb upstream.
+
+In the current code, the nvme is using a fixed 4k PRP entry size,
+but if the kernel use a page size which is more than 4k, we should
+consider the situation that the bv_offset may be larger than the
+dev->ctrl.page_size. Otherwise we may miss setting the prp2 and then
+cause the command can't be executed correctly.
+
+Fixes: dff824b2aadb ("nvme-pci: optimize mapping of small single segment requests")
+Cc: stable@vger.kernel.org
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Kevin Hao <haokexin@gmail.com>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/nvme/host/pci.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/nvme/host/pci.c
++++ b/drivers/nvme/host/pci.c
+@@ -769,7 +769,8 @@ static blk_status_t nvme_setup_prp_simpl
+               struct bio_vec *bv)
+ {
+       struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
+-      unsigned int first_prp_len = dev->ctrl.page_size - bv->bv_offset;
++      unsigned int offset = bv->bv_offset & (dev->ctrl.page_size - 1);
++      unsigned int first_prp_len = dev->ctrl.page_size - offset;
+       iod->first_dma = dma_map_bvec(dev->dev, bv, rq_dma_dir(req), 0);
+       if (dma_mapping_error(dev->dev, iod->first_dma))
diff --git a/queue-5.3/ocfs2-fix-panic-due-to-ocfs2_wq-is-null.patch b/queue-5.3/ocfs2-fix-panic-due-to-ocfs2_wq-is-null.patch
new file mode 100644 (file)
index 0000000..518e325
--- /dev/null
@@ -0,0 +1,78 @@
+From b918c43021baaa3648de09e19a4a3dd555a45f40 Mon Sep 17 00:00:00 2001
+From: Yi Li <yilikernel@gmail.com>
+Date: Fri, 18 Oct 2019 20:20:08 -0700
+Subject: ocfs2: fix panic due to ocfs2_wq is null
+
+From: Yi Li <yilikernel@gmail.com>
+
+commit b918c43021baaa3648de09e19a4a3dd555a45f40 upstream.
+
+mount.ocfs2 failed when reading ocfs2 filesystem superblock encounters
+an error.  ocfs2_initialize_super() returns before allocating ocfs2_wq.
+ocfs2_dismount_volume() triggers the following panic.
+
+  Oct 15 16:09:27 cnwarekv-205120 kernel: On-disk corruption discovered.Please run fsck.ocfs2 once the filesystem is unmounted.
+  Oct 15 16:09:27 cnwarekv-205120 kernel: (mount.ocfs2,22804,44): ocfs2_read_locked_inode:537 ERROR: status = -30
+  Oct 15 16:09:27 cnwarekv-205120 kernel: (mount.ocfs2,22804,44): ocfs2_init_global_system_inodes:458 ERROR: status = -30
+  Oct 15 16:09:27 cnwarekv-205120 kernel: (mount.ocfs2,22804,44): ocfs2_init_global_system_inodes:491 ERROR: status = -30
+  Oct 15 16:09:27 cnwarekv-205120 kernel: (mount.ocfs2,22804,44): ocfs2_initialize_super:2313 ERROR: status = -30
+  Oct 15 16:09:27 cnwarekv-205120 kernel: (mount.ocfs2,22804,44): ocfs2_fill_super:1033 ERROR: status = -30
+  ------------[ cut here ]------------
+  Oops: 0002 [#1] SMP NOPTI
+  CPU: 1 PID: 11753 Comm: mount.ocfs2 Tainted: G  E
+        4.14.148-200.ckv.x86_64 #1
+  Hardware name: Sugon H320-G30/35N16-US, BIOS 0SSDX017 12/21/2018
+  task: ffff967af0520000 task.stack: ffffa5f05484000
+  RIP: 0010:mutex_lock+0x19/0x20
+  Call Trace:
+    flush_workqueue+0x81/0x460
+    ocfs2_shutdown_local_alloc+0x47/0x440 [ocfs2]
+    ocfs2_dismount_volume+0x84/0x400 [ocfs2]
+    ocfs2_fill_super+0xa4/0x1270 [ocfs2]
+    ? ocfs2_initialize_super.isa.211+0xf20/0xf20 [ocfs2]
+    mount_bdev+0x17f/0x1c0
+    mount_fs+0x3a/0x160
+
+Link: http://lkml.kernel.org/r/1571139611-24107-1-git-send-email-yili@winhong.com
+Signed-off-by: Yi Li <yilikernel@gmail.com>
+Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
+Cc: Mark Fasheh <mark@fasheh.com>
+Cc: Joel Becker <jlbec@evilplan.org>
+Cc: Junxiao Bi <junxiao.bi@oracle.com>
+Cc: Changwei Ge <gechangwei@live.cn>
+Cc: Gang He <ghe@suse.com>
+Cc: Jun Piao <piaojun@huawei.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ocfs2/journal.c    |    3 ++-
+ fs/ocfs2/localalloc.c |    3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+--- a/fs/ocfs2/journal.c
++++ b/fs/ocfs2/journal.c
+@@ -217,7 +217,8 @@ void ocfs2_recovery_exit(struct ocfs2_su
+       /* At this point, we know that no more recovery threads can be
+        * launched, so wait for any recovery completion work to
+        * complete. */
+-      flush_workqueue(osb->ocfs2_wq);
++      if (osb->ocfs2_wq)
++              flush_workqueue(osb->ocfs2_wq);
+       /*
+        * Now that recovery is shut down, and the osb is about to be
+--- a/fs/ocfs2/localalloc.c
++++ b/fs/ocfs2/localalloc.c
+@@ -377,7 +377,8 @@ void ocfs2_shutdown_local_alloc(struct o
+       struct ocfs2_dinode *alloc = NULL;
+       cancel_delayed_work(&osb->la_enable_wq);
+-      flush_workqueue(osb->ocfs2_wq);
++      if (osb->ocfs2_wq)
++              flush_workqueue(osb->ocfs2_wq);
+       if (osb->local_alloc_state == OCFS2_LA_UNUSED)
+               goto out;
index 4ffc3674b4da71231af7b38c88b1160f7d54a0df..9e5172c5edbb2850878201ffdbd64180536b7378 100644 (file)
@@ -56,3 +56,5 @@ net-phy-fix-write-to-mii-ctrl1000-register.patch
 namespace-fix-namespace.pl-script-to-support-relativ.patch
 convert-filldir-64-from-__put_user-to-unsafe_put_use.patch
 elf-don-t-use-map_fixed_noreplace-for-elf-executable.patch
+ocfs2-fix-panic-due-to-ocfs2_wq-is-null.patch
+nvme-pci-set-the-prp2-correctly-when-using-more-than-4k-page.patch