From cf7a5c74cbf834f43bd3c2770a2836c9d516c194 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 5 Dec 2014 10:00:56 -0800 Subject: [PATCH] 3.14-stable patches added patches: locks-eliminate-bug-call-when-there-s-an-unexpected-lock-on-file-close.patch powerpc-powernv-honor-the-generic-no_64bit_msi-flag.patch --- ...e-s-an-unexpected-lock-on-file-close.patch | 64 +++++++++++++++++++ ...-honor-the-generic-no_64bit_msi-flag.patch | 57 +++++++++++++++++ queue-3.14/series | 2 + 3 files changed, 123 insertions(+) create mode 100644 queue-3.14/locks-eliminate-bug-call-when-there-s-an-unexpected-lock-on-file-close.patch create mode 100644 queue-3.14/powerpc-powernv-honor-the-generic-no_64bit_msi-flag.patch diff --git a/queue-3.14/locks-eliminate-bug-call-when-there-s-an-unexpected-lock-on-file-close.patch b/queue-3.14/locks-eliminate-bug-call-when-there-s-an-unexpected-lock-on-file-close.patch new file mode 100644 index 00000000000..517070344d2 --- /dev/null +++ b/queue-3.14/locks-eliminate-bug-call-when-there-s-an-unexpected-lock-on-file-close.patch @@ -0,0 +1,64 @@ +From 8c3cac5e6a85f03602ffe09c44f14418699e31ec Mon Sep 17 00:00:00 2001 +From: Jeff Layton +Date: Mon, 3 Feb 2014 12:13:07 -0500 +Subject: locks: eliminate BUG() call when there's an unexpected lock on file close + +From: Jeff Layton + +commit 8c3cac5e6a85f03602ffe09c44f14418699e31ec upstream. + +A leftover lock on the list is surely a sign of a problem of some sort, +but it's not necessarily a reason to panic the box. Instead, just log a +warning with some info about the lock, and then delete it like we would +any other lock. + +In the event that the filesystem declares a ->lock f_op, we may end up +leaking something, but that's generally preferable to an immediate +panic. + +Acked-by: J. Bruce Fields +Signed-off-by: Jeff Layton +Cc: Markus Blank-Burian +Signed-off-by: Greg Kroah-Hartman + +--- + fs/locks.c | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +--- a/fs/locks.c ++++ b/fs/locks.c +@@ -2235,16 +2235,28 @@ void locks_remove_flock(struct file *fil + + while ((fl = *before) != NULL) { + if (fl->fl_file == filp) { +- if (IS_FLOCK(fl)) { +- locks_delete_lock(before); +- continue; +- } + if (IS_LEASE(fl)) { + lease_modify(before, F_UNLCK); + continue; + } +- /* What? */ +- BUG(); ++ ++ /* ++ * There's a leftover lock on the list of a type that ++ * we didn't expect to see. Most likely a classic ++ * POSIX lock that ended up not getting released ++ * properly, or that raced onto the list somehow. Log ++ * some info about it and then just remove it from ++ * the list. ++ */ ++ WARN(!IS_FLOCK(fl), ++ "leftover lock: dev=%u:%u ino=%lu type=%hhd flags=0x%x start=%lld end=%lld\n", ++ MAJOR(inode->i_sb->s_dev), ++ MINOR(inode->i_sb->s_dev), inode->i_ino, ++ fl->fl_type, fl->fl_flags, ++ fl->fl_start, fl->fl_end); ++ ++ locks_delete_lock(before); ++ continue; + } + before = &fl->fl_next; + } diff --git a/queue-3.14/powerpc-powernv-honor-the-generic-no_64bit_msi-flag.patch b/queue-3.14/powerpc-powernv-honor-the-generic-no_64bit_msi-flag.patch new file mode 100644 index 00000000000..1705f6eed24 --- /dev/null +++ b/queue-3.14/powerpc-powernv-honor-the-generic-no_64bit_msi-flag.patch @@ -0,0 +1,57 @@ +From 360743814c4082515581aa23ab1d8e699e1fbe88 Mon Sep 17 00:00:00 2001 +From: Benjamin Herrenschmidt +Date: Tue, 7 Oct 2014 16:12:36 +1100 +Subject: powerpc/powernv: Honor the generic "no_64bit_msi" flag + +From: Benjamin Herrenschmidt + +commit 360743814c4082515581aa23ab1d8e699e1fbe88 upstream. + +Instead of the arch specific quirk which we are deprecating +and that drivers don't understand. + +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/platforms/powernv/pci-ioda.c | 3 +-- + arch/powerpc/platforms/powernv/pci.c | 4 ++-- + 2 files changed, 3 insertions(+), 4 deletions(-) + +--- a/arch/powerpc/platforms/powernv/pci-ioda.c ++++ b/arch/powerpc/platforms/powernv/pci-ioda.c +@@ -902,7 +902,6 @@ static int pnv_pci_ioda_msi_setup(struct + unsigned int is_64, struct msi_msg *msg) + { + struct pnv_ioda_pe *pe = pnv_ioda_get_pe(dev); +- struct pci_dn *pdn = pci_get_pdn(dev); + struct irq_data *idata; + struct irq_chip *ichip; + unsigned int xive_num = hwirq - phb->msi_base; +@@ -918,7 +917,7 @@ static int pnv_pci_ioda_msi_setup(struct + return -ENXIO; + + /* Force 32-bit MSI on some broken devices */ +- if (pdn && pdn->force_32bit_msi) ++ if (dev->no_64bit_msi) + is_64 = 0; + + /* Assign XIVE to PE */ +--- a/arch/powerpc/platforms/powernv/pci.c ++++ b/arch/powerpc/platforms/powernv/pci.c +@@ -1,3 +1,4 @@ ++ + /* + * Support PCI/PCIe on PowerNV platforms + * +@@ -50,9 +51,8 @@ static int pnv_msi_check_device(struct p + { + struct pci_controller *hose = pci_bus_to_host(pdev->bus); + struct pnv_phb *phb = hose->private_data; +- struct pci_dn *pdn = pci_get_pdn(pdev); + +- if (pdn && pdn->force_32bit_msi && !phb->msi32_support) ++ if (pdev->no_64bit_msi && !phb->msi32_support) + return -ENODEV; + + return (phb && phb->msi_bmp.bitmap) ? 0 : -ENODEV; diff --git a/queue-3.14/series b/queue-3.14/series index 81999c8d92a..1528fa47fb9 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -66,3 +66,5 @@ bnx2fc-do-not-add-shared-skbs-to-the-fcoe_rx_list.patch drm-radeon-fix-endian-swapping-in-vbios-fetch-for-tdp-table.patch gpu-radeon-set-flag-to-indicate-broken-64-bit-msi.patch bitops-fix-shift-overflow-in-genmask-macros.patch +locks-eliminate-bug-call-when-there-s-an-unexpected-lock-on-file-close.patch +powerpc-powernv-honor-the-generic-no_64bit_msi-flag.patch -- 2.47.3