--- /dev/null
+From 90d0f0f11588ec692c12f9009089b398be395184 Mon Sep 17 00:00:00 2001
+From: Ming Lei <ming.lei@canonical.com>
+Date: Sat, 12 Mar 2016 22:56:19 +0800
+Subject: block: don't optimize for non-cloned bio in bio_get_last_bvec()
+
+From: Ming Lei <ming.lei@canonical.com>
+
+commit 90d0f0f11588ec692c12f9009089b398be395184 upstream.
+
+For !BIO_CLONED bio, we can use .bi_vcnt safely, but it
+doesn't mean we can just simply return .bi_io_vec[.bi_vcnt - 1]
+because the start postion may have been moved in the middle of
+the bvec, such as splitting in the middle of bvec.
+
+Fixes: 7bcd79ac50d9(block: bio: introduce helpers to get the 1st and last bvec)
+Reported-by: Kent Overstreet <kent.overstreet@gmail.com>
+Signed-off-by: Ming Lei <ming.lei@canonical.com>
+Signed-off-by: Jens Axboe <axboe@fb.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/bio.h | 5 -----
+ 1 file changed, 5 deletions(-)
+
+--- a/include/linux/bio.h
++++ b/include/linux/bio.h
+@@ -320,11 +320,6 @@ static inline void bio_get_last_bvec(str
+ struct bvec_iter iter = bio->bi_iter;
+ int idx;
+
+- if (!bio_flagged(bio, BIO_CLONED)) {
+- *bv = bio->bi_io_vec[bio->bi_vcnt - 1];
+- return;
+- }
+-
+ if (unlikely(!bio_multiple_segments(bio))) {
+ *bv = bio_iovec(bio);
+ return;
--- /dev/null
+From 4b7b1ef2c2f83d702272555e8adb839a50ba0f8e Mon Sep 17 00:00:00 2001
+From: James Hogan <james.hogan@imgtec.com>
+Date: Tue, 8 Mar 2016 16:47:53 +0000
+Subject: ld-version: Fix awk regex compile failure
+
+From: James Hogan <james.hogan@imgtec.com>
+
+commit 4b7b1ef2c2f83d702272555e8adb839a50ba0f8e upstream.
+
+The ld-version.sh script fails on some versions of awk with the
+following error, resulting in build failures for MIPS:
+
+awk: scripts/ld-version.sh: line 4: regular expression compile failed (missing '(')
+
+This is due to the regular expression ".*)", meant to strip off the
+beginning of the ld version string up to the close bracket, however
+brackets have a meaning in regular expressions, so lets escape it so
+that awk doesn't expect a corresponding open bracket.
+
+Fixes: ccbef1674a15 ("Kbuild, lto: add ld-version and ld-ifversion ...")
+Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: James Hogan <james.hogan@imgtec.com>
+Tested-by: Michael S. Tsirkin <mst@redhat.com>
+Acked-by: Michael S. Tsirkin <mst@redhat.com>
+Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
+Cc: Michal Marek <mmarek@suse.com>
+Cc: Andi Kleen <ak@linux.intel.com>
+Cc: Geert Uytterhoeven <geert@linux-m68k.org>
+Cc: linux-mips@linux-mips.org
+Cc: linux-kbuild@vger.kernel.org
+Cc: linux-kernel@vger.kernel.org
+Patchwork: https://patchwork.linux-mips.org/patch/12838/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ scripts/ld-version.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/scripts/ld-version.sh
++++ b/scripts/ld-version.sh
+@@ -1,7 +1,7 @@
+ #!/usr/bin/awk -f
+ # extract linker version number from stdin and turn into single number
+ {
+- gsub(".*)", "");
++ gsub(".*\\)", "");
+ split($1,a, ".");
+ print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];
+ exit
--- /dev/null
+From 7a50e4688dabb8005df39b2b992d76629b8af8aa Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 6 Mar 2016 22:28:56 +0100
+Subject: MIPS: Fix build error when SMP is used without GIC
+
+From: Hauke Mehrtens <hauke@hauke-m.de>
+
+commit 7a50e4688dabb8005df39b2b992d76629b8af8aa upstream.
+
+The MIPS_GIC_IPI should only be selected when MIPS_GIC is also
+selected, otherwise it results in a compile error. smp-gic.c uses some
+functions from include/linux/irqchip/mips-gic.h like
+plat_ipi_call_int_xlate() which are only added to the header file when
+MIPS_GIC is set. The Lantiq SoC does not use the GIC, but supports SMP.
+The calls top the functions from smp-gic.c are already protected by
+some #ifdefs
+
+The first part of this was introduced in commit 72e20142b2bf ("MIPS:
+Move GIC IPI functions out of smp-cmp.c")
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+Cc: Paul Burton <paul.burton@imgtec.com>
+Cc: linux-mips@linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/12774/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mips/Kconfig | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -2155,7 +2155,7 @@ config MIPS_MT_SMP
+ select CPU_MIPSR2_IRQ_VI
+ select CPU_MIPSR2_IRQ_EI
+ select SYNC_R4K
+- select MIPS_GIC_IPI
++ select MIPS_GIC_IPI if MIPS_GIC
+ select MIPS_MT
+ select SMP
+ select SMP_UP
+@@ -2253,7 +2253,7 @@ config MIPS_VPE_APSP_API_MT
+ config MIPS_CMP
+ bool "MIPS CMP framework support (DEPRECATED)"
+ depends on SYS_SUPPORTS_MIPS_CMP && !CPU_MIPSR6
+- select MIPS_GIC_IPI
++ select MIPS_GIC_IPI if MIPS_GIC
+ select SMP
+ select SYNC_R4K
+ select SYS_SUPPORTS_SMP
+@@ -2273,7 +2273,7 @@ config MIPS_CPS
+ select MIPS_CM
+ select MIPS_CPC
+ select MIPS_CPS_PM if HOTPLUG_CPU
+- select MIPS_GIC_IPI
++ select MIPS_GIC_IPI if MIPS_GIC
+ select SMP
+ select SYNC_R4K if (CEVT_R4K || CSRC_R4K)
+ select SYS_SUPPORTS_HOTPLUG_CPU
+@@ -2292,6 +2292,7 @@ config MIPS_CPS_PM
+ bool
+
+ config MIPS_GIC_IPI
++ depends on MIPS_GIC
+ bool
+
+ config MIPS_CM
--- /dev/null
+From d825c06bfe8b885b797f917ad47365d0e9c21fbb Mon Sep 17 00:00:00 2001
+From: James Hogan <james.hogan@imgtec.com>
+Date: Fri, 4 Mar 2016 10:10:51 +0000
+Subject: MIPS: smp.c: Fix uninitialised temp_foreign_map
+
+From: James Hogan <james.hogan@imgtec.com>
+
+commit d825c06bfe8b885b797f917ad47365d0e9c21fbb upstream.
+
+When calculate_cpu_foreign_map() recalculates the cpu_foreign_map
+cpumask it uses the local variable temp_foreign_map without initialising
+it to zero. Since the calculation only ever sets bits in this cpumask
+any existing bits at that memory location will remain set and find their
+way into cpu_foreign_map too. This could potentially lead to cache
+operations suboptimally doing smp calls to multiple VPEs in the same
+core, even though the VPEs share primary caches.
+
+Therefore initialise temp_foreign_map using cpumask_clear() before use.
+
+Fixes: cccf34e9411c ("MIPS: c-r4k: Fix cache flushing for MT cores")
+Signed-off-by: James Hogan <james.hogan@imgtec.com>
+Cc: Paul Burton <paul.burton@imgtec.com>
+Cc: linux-mips@linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/12759/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mips/kernel/smp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/mips/kernel/smp.c
++++ b/arch/mips/kernel/smp.c
+@@ -121,6 +121,7 @@ static inline void calculate_cpu_foreign
+ cpumask_t temp_foreign_map;
+
+ /* Re-calculate the mask */
++ cpumask_clear(&temp_foreign_map);
+ for_each_online_cpu(i) {
+ core_present = 0;
+ for_each_cpu(k, &temp_foreign_map)
userfaultfd-don-t-block-on-the-last-vm-updates-at-exit-time.patch
ovl-copy-new-uid-gid-into-overlayfs-runtime-inode.patch
ovl-fix-getcwd-failure-after-unsuccessful-rmdir.patch
+mips-fix-build-error-when-smp-is-used-without-gic.patch
+mips-smp.c-fix-uninitialised-temp_foreign_map.patch
+block-don-t-optimize-for-non-cloned-bio-in-bio_get_last_bvec.patch
+target-drop-incorrect-abort_task-put-for-completed-commands.patch
+ld-version-fix-awk-regex-compile-failure.patch
--- /dev/null
+From 7f54ab5ff52fb0b91569bc69c4a6bc5cac1b768d Mon Sep 17 00:00:00 2001
+From: Nicholas Bellinger <nab@linux-iscsi.org>
+Date: Sat, 5 Mar 2016 20:00:12 -0800
+Subject: target: Drop incorrect ABORT_TASK put for completed commands
+
+From: Nicholas Bellinger <nab@linux-iscsi.org>
+
+commit 7f54ab5ff52fb0b91569bc69c4a6bc5cac1b768d upstream.
+
+This patch fixes a recent ABORT_TASK regression associated
+with commit febe562c, where a left-over target_put_sess_cmd()
+would still be called when __target_check_io_state() detected
+a command has already been completed, and explicit ABORT must
+be avoided.
+
+Note commit febe562c dropped the local kref_get_unless_zero()
+check in core_tmr_abort_task(), but did not drop this extra
+corresponding target_put_sess_cmd() in the failure path.
+
+So go ahead and drop this now bogus target_put_sess_cmd(),
+and avoid this potential use-after-free.
+
+Reported-by: Dan Lane <dracodan@gmail.com>
+Cc: Quinn Tran <quinn.tran@qlogic.com>
+Cc: Himanshu Madhani <himanshu.madhani@qlogic.com>
+Cc: Sagi Grimberg <sagig@mellanox.com>
+Cc: Christoph Hellwig <hch@lst.de>
+Cc: Hannes Reinecke <hare@suse.de>
+Cc: Andy Grover <agrover@redhat.com>
+Cc: Mike Christie <mchristi@redhat.com>
+Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/target/target_core_tmr.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/target/target_core_tmr.c
++++ b/drivers/target/target_core_tmr.c
+@@ -177,7 +177,6 @@ void core_tmr_abort_task(
+
+ if (!__target_check_io_state(se_cmd, se_sess, 0)) {
+ spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags);
+- target_put_sess_cmd(se_cmd);
+ goto out;
+ }
+ list_del_init(&se_cmd->se_cmd_list);