From: Greg Kroah-Hartman Date: Mon, 3 Jul 2017 10:02:28 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v3.18.60~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fab51fb1f9ae1b1510979bb9d0860486bbccc0d1;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: btrfs-fix-truncate-down-when-no_holes-feature-is-enabled.patch gianfar-do-not-reuse-pages-from-emergency-reserve.patch powerpc-eeh-enable-io-path-on-permanent-error.patch --- diff --git a/queue-4.4/btrfs-fix-truncate-down-when-no_holes-feature-is-enabled.patch b/queue-4.4/btrfs-fix-truncate-down-when-no_holes-feature-is-enabled.patch new file mode 100644 index 00000000000..39b28bcfee4 --- /dev/null +++ b/queue-4.4/btrfs-fix-truncate-down-when-no_holes-feature-is-enabled.patch @@ -0,0 +1,54 @@ +From foo@baz Mon Jul 3 11:54:22 CEST 2017 +From: Liu Bo +Date: Thu, 1 Dec 2016 13:43:31 -0800 +Subject: Btrfs: fix truncate down when no_holes feature is enabled + +From: Liu Bo + + +[ Upstream commit 91298eec05cd8d4e828cf7ee5d4a6334f70cf69a ] + +For such a file mapping, + +[0-4k][hole][8k-12k] + +In NO_HOLES mode, we don't have the [hole] extent any more. +Commit c1aa45759e90 ("Btrfs: fix shrinking truncate when the no_holes feature is enabled") + fixed disk isize not being updated in NO_HOLES mode when data is not flushed. + +However, even if data has been flushed, we can still have trouble +in updating disk isize since we updated disk isize to 'start' of +the last evicted extent. + +Reviewed-by: Chris Mason +Signed-off-by: Liu Bo +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/inode.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -4397,8 +4397,19 @@ search_again: + if (found_type > min_type) { + del_item = 1; + } else { +- if (item_end < new_size) ++ if (item_end < new_size) { ++ /* ++ * With NO_HOLES mode, for the following mapping ++ * ++ * [0-4k][hole][8k-12k] ++ * ++ * if truncating isize down to 6k, it ends up ++ * isize being 8k. ++ */ ++ if (btrfs_fs_incompat(root->fs_info, NO_HOLES)) ++ last_size = new_size; + break; ++ } + if (found_key.offset >= new_size) + del_item = 1; + else diff --git a/queue-4.4/gianfar-do-not-reuse-pages-from-emergency-reserve.patch b/queue-4.4/gianfar-do-not-reuse-pages-from-emergency-reserve.patch new file mode 100644 index 00000000000..0d250a94cac --- /dev/null +++ b/queue-4.4/gianfar-do-not-reuse-pages-from-emergency-reserve.patch @@ -0,0 +1,41 @@ +From foo@baz Mon Jul 3 11:54:22 CEST 2017 +From: Eric Dumazet +Date: Wed, 18 Jan 2017 19:44:42 -0800 +Subject: gianfar: Do not reuse pages from emergency reserve + +From: Eric Dumazet + + +[ Upstream commit 69fed99baac186013840ced3524562841296034f ] + +A driver using dev_alloc_page() must not reuse a page that had to +use emergency memory reserve. + +Otherwise all packets using this page will be immediately dropped, +unless for very specific sockets having SOCK_MEMALLOC bit set. + +This issue might be hard to debug, because only a fraction of the RX +ring buffer would suffer from drops. + +Fixes: 75354148ce69 ("gianfar: Add paged allocation and Rx S/G") +Signed-off-by: Eric Dumazet +Cc: Claudiu Manoil +Acked-by: Claudiu Manoil +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/freescale/gianfar.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/freescale/gianfar.c ++++ b/drivers/net/ethernet/freescale/gianfar.c +@@ -2939,7 +2939,7 @@ static bool gfar_add_rx_frag(struct gfar + size, GFAR_RXB_TRUESIZE); + + /* try reuse page */ +- if (unlikely(page_count(page) != 1)) ++ if (unlikely(page_count(page) != 1 || page_is_pfmemalloc(page))) + return false; + + /* change offset to the other half */ diff --git a/queue-4.4/powerpc-eeh-enable-io-path-on-permanent-error.patch b/queue-4.4/powerpc-eeh-enable-io-path-on-permanent-error.patch new file mode 100644 index 00000000000..85943b0b34f --- /dev/null +++ b/queue-4.4/powerpc-eeh-enable-io-path-on-permanent-error.patch @@ -0,0 +1,62 @@ +From foo@baz Mon Jul 3 11:54:22 CEST 2017 +From: Gavin Shan +Date: Fri, 6 Jan 2017 10:39:49 +1100 +Subject: powerpc/eeh: Enable IO path on permanent error + +From: Gavin Shan + + +[ Upstream commit 387bbc974f6adf91aa635090f73434ed10edd915 ] + +We give up recovery on permanent error, simply shutdown the affected +devices and remove them. If the devices can't be put into quiet state, +they spew more traffic that is likely to cause another unexpected EEH +error. This was observed on "p8dtu2u" machine: + + 0002:00:00.0 PCI bridge: IBM Device 03dc + 0002:01:00.0 Ethernet controller: Intel Corporation \ + Ethernet Controller X710/X557-AT 10GBASE-T (rev 02) + 0002:01:00.1 Ethernet controller: Intel Corporation \ + Ethernet Controller X710/X557-AT 10GBASE-T (rev 02) + 0002:01:00.2 Ethernet controller: Intel Corporation \ + Ethernet Controller X710/X557-AT 10GBASE-T (rev 02) + 0002:01:00.3 Ethernet controller: Intel Corporation \ + Ethernet Controller X710/X557-AT 10GBASE-T (rev 02) + +On P8 PowerNV platform, the IO path is frozen when shutdowning the +devices, meaning the memory registers are inaccessible. It is why +the devices can't be put into quiet state before removing them. +This fixes the issue by enabling IO path prior to putting the devices +into quiet state. + +Reported-by: Pridhiviraj Paidipeddi +Signed-off-by: Gavin Shan +Acked-by: Russell Currey +Signed-off-by: Michael Ellerman +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/kernel/eeh.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/arch/powerpc/kernel/eeh.c ++++ b/arch/powerpc/kernel/eeh.c +@@ -304,9 +304,17 @@ void eeh_slot_error_detail(struct eeh_pe + * + * For pHyp, we have to enable IO for log retrieval. Otherwise, + * 0xFF's is always returned from PCI config space. ++ * ++ * When the @severity is EEH_LOG_PERM, the PE is going to be ++ * removed. Prior to that, the drivers for devices included in ++ * the PE will be closed. The drivers rely on working IO path ++ * to bring the devices to quiet state. Otherwise, PCI traffic ++ * from those devices after they are removed is like to cause ++ * another unexpected EEH error. + */ + if (!(pe->type & EEH_PE_PHB)) { +- if (eeh_has_flag(EEH_ENABLE_IO_FOR_LOG)) ++ if (eeh_has_flag(EEH_ENABLE_IO_FOR_LOG) || ++ severity == EEH_LOG_PERM) + eeh_pci_enable(pe, EEH_OPT_THAW_MMIO); + + /* diff --git a/queue-4.4/series b/queue-4.4/series index e1e512406b6..5b727abec04 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -49,3 +49,6 @@ bgmac-fix-reversed-test-of-build_skb-return-value.patch net-bgmac-fix-sof-bit-checking.patch net-bgmac-start-transmit-queue-in-bgmac_open.patch net-bgmac-remove-superflous-netif_carrier_on.patch +powerpc-eeh-enable-io-path-on-permanent-error.patch +gianfar-do-not-reuse-pages-from-emergency-reserve.patch +btrfs-fix-truncate-down-when-no_holes-feature-is-enabled.patch