--- /dev/null
+From 320f35b7bf8cccf1997ca3126843535e1b95e9c4 Mon Sep 17 00:00:00 2001
+From: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
+Date: Mon, 26 Nov 2018 18:35:14 +0100
+Subject: flexfiles: enforce per-mirror stateid only for v4 DSes
+
+From: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
+
+commit 320f35b7bf8cccf1997ca3126843535e1b95e9c4 upstream.
+
+Since commit bb21ce0ad227 we always enforce per-mirror stateid.
+However, this makes sense only for v4+ servers.
+
+Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/flexfilelayout/flexfilelayout.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/fs/nfs/flexfilelayout/flexfilelayout.c
++++ b/fs/nfs/flexfilelayout/flexfilelayout.c
+@@ -1725,7 +1725,8 @@ ff_layout_read_pagelist(struct nfs_pgio_
+ if (fh)
+ hdr->args.fh = fh;
+
+- if (!nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid))
++ if (vers == 4 &&
++ !nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid))
+ goto out_failed;
+
+ /*
+@@ -1790,7 +1791,8 @@ ff_layout_write_pagelist(struct nfs_pgio
+ if (fh)
+ hdr->args.fh = fh;
+
+- if (!nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid))
++ if (vers == 4 &&
++ !nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid))
+ goto out_failed;
+
+ /*
--- /dev/null
+From 0b548e33e6cb2bff240fdaf1783783be15c29080 Mon Sep 17 00:00:00 2001
+From: Davidlohr Bueso <dave@stgolabs.net>
+Date: Fri, 17 Nov 2017 15:28:27 -0800
+Subject: lib/rbtree-test: lower default params
+
+From: Davidlohr Bueso <dave@stgolabs.net>
+
+commit 0b548e33e6cb2bff240fdaf1783783be15c29080 upstream.
+
+Fengguang reported soft lockups while running the rbtree and interval
+tree test modules. The logic for these tests all occur in init phase,
+and we currently are pounding with the default values for number of
+nodes and number of iterations of each test. Reduce the latter by two
+orders of magnitude. This does not influence the value of the tests in
+that one thousand times by default is enough to get the picture.
+
+Link: http://lkml.kernel.org/r/20171109161715.xai2dtwqw2frhkcm@linux-n805
+Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
+Reported-by: Fengguang Wu <fengguang.wu@intel.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ lib/interval_tree_test.c | 4 ++--
+ lib/rbtree_test.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/lib/interval_tree_test.c
++++ b/lib/interval_tree_test.c
+@@ -11,10 +11,10 @@
+ MODULE_PARM_DESC(name, msg);
+
+ __param(int, nnodes, 100, "Number of nodes in the interval tree");
+-__param(int, perf_loops, 100000, "Number of iterations modifying the tree");
++__param(int, perf_loops, 1000, "Number of iterations modifying the tree");
+
+ __param(int, nsearches, 100, "Number of searches to the interval tree");
+-__param(int, search_loops, 10000, "Number of iterations searching the tree");
++__param(int, search_loops, 1000, "Number of iterations searching the tree");
+ __param(bool, search_all, false, "Searches will iterate all nodes in the tree");
+
+ __param(uint, max_endpoint, ~0, "Largest value for the interval's endpoint");
+--- a/lib/rbtree_test.c
++++ b/lib/rbtree_test.c
+@@ -11,7 +11,7 @@
+ MODULE_PARM_DESC(name, msg);
+
+ __param(int, nnodes, 100, "Number of nodes in the rb-tree");
+-__param(int, perf_loops, 100000, "Number of iterations modifying the rb-tree");
++__param(int, perf_loops, 1000, "Number of iterations modifying the rb-tree");
+ __param(int, check_loops, 100, "Number of iterations modifying and verifying the rb-tree");
+
+ struct test_node {