--- /dev/null
+From c93db7bb6ef3251e0ea48ade311d3e9942748e1c Mon Sep 17 00:00:00 2001
+From: Matthew Wilcox <willy@infradead.org>
+Date: Tue, 27 Nov 2018 13:16:33 -0800
+Subject: dax: Check page->mapping isn't NULL
+
+From: Matthew Wilcox <willy@infradead.org>
+
+commit c93db7bb6ef3251e0ea48ade311d3e9942748e1c upstream.
+
+If we race with inode destroy, it's possible for page->mapping to be
+NULL before we even enter this routine, as well as after having slept
+waiting for the dax entry to become unlocked.
+
+Fixes: c2a7d2a11552 ("filesystem-dax: Introduce dax_lock_mapping_entry()")
+Cc: <stable@vger.kernel.org>
+Reported-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Matthew Wilcox <willy@infradead.org>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Reviewed-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/dax.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/dax.c
++++ b/fs/dax.c
+@@ -423,7 +423,7 @@ bool dax_lock_mapping_entry(struct page
+ for (;;) {
+ mapping = READ_ONCE(page->mapping);
+
+- if (!dax_mapping(mapping))
++ if (!mapping || !dax_mapping(mapping))
+ break;
+
+ /*
--- /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
+@@ -1733,7 +1733,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;
+
+ /*
+@@ -1798,7 +1799,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;
+
+ /*
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- fs/ocfs2/export.c | 2 +-
+ fs/ocfs2/export.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c
-index 9f88188060db..4bf8d5854b27 100644
--- a/fs/ocfs2/export.c
+++ b/fs/ocfs2/export.c
-@@ -125,10 +125,10 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
+@@ -125,10 +125,10 @@ check_err:
check_gen:
if (handle->ih_generation != inode->i_generation) {
result = ERR_PTR(-ESTALE);
goto bail;
}
---
-2.19.1
-
kernel-kcov.c-mark-funcs-in-__sanitizer_cov_trace_pc.patch
initramfs-clean-old-path-before-creating-a-hardlink.patch
ocfs2-fix-potential-use-after-free.patch
+flexfiles-enforce-per-mirror-stateid-only-for-v4-dses.patch
+dax-check-page-mapping-isn-t-null.patch