Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-10-04 11:01:52 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-10-04 11:01:52 +0200
commit958c00e5a6dc506e1d27520e4a63967eabe95bed (patch)
treed41396d81446506fb31e3aea9cf5f8f4a57f992e
parentd2ea3169c89edccb300180e0dc4b7edf1a47ea6f (diff)
parent1992d65b5810c9827788f7b1af7d82292b18ca34 (diff)
Merge branch 'users/nfbrown/SLE15/for-next' into SLE15
Pull NFS fixes from Neil Brown
-rw-r--r--patches.kabi/0001-NFS-Ensure-we-commit-after-writeback-is-complete.kabi10
-rw-r--r--patches.kabi/NFSv4-Fix-OPEN-CLOSE-race.patch77
-rw-r--r--patches.suse/NFS-Don-t-interrupt-file-writeout-due-to-fatal-error.patch31
-rw-r--r--patches.suse/NFS-Don-t-open-code-clearing-of-delegation-state.patch75
-rw-r--r--patches.suse/NFS-Ensure-O_DIRECT-reports-an-error-if-the-bytes-re.patch84
-rw-r--r--patches.suse/NFS-Fix-regression-whereby-fscache-errors-are-appear.patch78
-rw-r--r--patches.suse/NFS-Forbid-setting-AF_INET6-to-struct-sockaddr_in-si.patch42
-rw-r--r--patches.suse/NFS-Refactor-nfs_lookup_revalidate.patch293
-rw-r--r--patches.suse/NFS-Remove-redundant-semicolon.patch29
-rw-r--r--patches.suse/NFS4-Fix-v4.0-client-state-corruption-when-mount.patch45
-rw-r--r--patches.suse/NFSv4-Check-the-return-value-of-update_open_stateid.patch49
-rw-r--r--patches.suse/NFSv4-Fix-OPEN-CLOSE-race.patch335
-rw-r--r--patches.suse/NFSv4-Fix-a-potential-sleep-while-atomic-in-nfs4_do_.patch135
-rw-r--r--patches.suse/NFSv4-Fix-an-Oops-in-nfs4_do_setattr.patch32
-rw-r--r--patches.suse/NFSv4-Fix-delegation-state-recovery.patch110
-rw-r--r--patches.suse/NFSv4-Fix-lookup-revalidate-of-regular-files.patch148
-rw-r--r--patches.suse/NFSv4-Handle-the-special-Linux-file-open-access-mode.patch47
-rw-r--r--patches.suse/NFSv4-Only-pass-the-delegation-to-setattr-if-we-re-s.patch57
-rw-r--r--patches.suse/NFSv4-pnfs-Fix-a-page-lock-leak-in-nfs_pageio_resend.patch52
-rw-r--r--patches.suse/NFSv4.1-Again-fix-a-race-where-CB_NOTIFY_LOCK-fails-.patch89
-rw-r--r--patches.suse/NFSv4.1-Fix-open-stateid-recovery.patch168
-rw-r--r--patches.suse/NFSv4.1-Only-reap-expired-delegations.patch64
-rw-r--r--patches.suse/PNFS-fallback-to-MDS-if-no-deviceid-found.patch32
-rw-r--r--patches.suse/SUNRPC-Handle-connection-breakages-correctly-in-call.patch29
-rw-r--r--patches.suse/SUNRPC-fix-regression-in-umount-of-a-secure-mount.patch36
-rw-r--r--patches.suse/SUNRPC-nfs-Fix-return-value-for-nfs4_callback_compou.patch103
-rw-r--r--patches.suse/nfsd-Don-t-release-the-callback-slot-unless-it-was-a.patch81
-rw-r--r--patches.suse/pNFS-flexfiles-Turn-off-soft-RPC-calls.patch42
-rw-r--r--patches.suse/pnfs-flexfiles-Fix-PTR_ERR-dereferences-in-ff_layout.patch31
-rw-r--r--series.conf29
30 files changed, 2428 insertions, 5 deletions
diff --git a/patches.kabi/0001-NFS-Ensure-we-commit-after-writeback-is-complete.kabi b/patches.kabi/0001-NFS-Ensure-we-commit-after-writeback-is-complete.kabi
index 4b69456df8..562a2080ec 100644
--- a/patches.kabi/0001-NFS-Ensure-we-commit-after-writeback-is-complete.kabi
+++ b/patches.kabi/0001-NFS-Ensure-we-commit-after-writeback-is-complete.kabi
@@ -105,18 +105,18 @@ Signed-off-by: NeilBrown <neilb@suse.com>
}
static bool nfs_match_lock_context(const struct nfs_lock_context *l1,
-@@ -1239,7 +1249,7 @@ int nfs_pageio_resend(struct nfs_pageio_
+@@ -1254,7 +1264,7 @@ int nfs_pageio_resend(struct nfs_pageio_
{
- LIST_HEAD(failed);
+ LIST_HEAD(pages);
- desc->pg_io_completion = hdr->io_completion;
+ *pg_io_completion(desc) = hdr->io_completion;
desc->pg_dreq = hdr->dreq;
- while (!list_empty(&hdr->pages)) {
- struct nfs_page *req = nfs_list_entry(hdr->pages.next);
+ list_splice_init(&hdr->pages, &pages);
+ while (!list_empty(&pages)) {
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
-@@ -740,7 +740,7 @@ int nfs_writepages(struct address_space
+@@ -744,7 +744,7 @@ int nfs_writepages(struct address_space
nfs_pageio_init_write(&pgio, inode, wb_priority(wbc), false,
&nfs_async_write_completion_ops);
diff --git a/patches.kabi/NFSv4-Fix-OPEN-CLOSE-race.patch b/patches.kabi/NFSv4-Fix-OPEN-CLOSE-race.patch
new file mode 100644
index 0000000000..6126a53991
--- /dev/null
+++ b/patches.kabi/NFSv4-Fix-OPEN-CLOSE-race.patch
@@ -0,0 +1,77 @@
+From: NeilBrown <neilb@suse.de>
+Subject: Fix kabi for: NFSv4: Fix OPEN / CLOSE race
+References: git-fixes
+Patch-mainline: Never, kabi
+
+Adding a waitq to the nfs4_state breaks the kabi.
+So instead use wait_on_bit which provides its own
+waitq.
+
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ fs/nfs/nfs4_fs.h | 2 --
+ fs/nfs/nfs4proc.c | 10 ++++++----
+ fs/nfs/nfs4state.c | 1 -
+ 3 files changed, 6 insertions(+), 7 deletions(-)
+
+--- a/fs/nfs/nfs4_fs.h
++++ b/fs/nfs/nfs4_fs.h
+@@ -185,8 +185,6 @@ struct nfs4_state {
+ unsigned int n_rdwr; /* Number of read/write references */
+ fmode_t state; /* State on the server (R,W, or RW) */
+ atomic_t count;
+-
+- wait_queue_head_t waitq;
+ };
+
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -1399,7 +1399,7 @@ static bool nfs_open_stateid_recover_ope
+ static void nfs_state_log_update_open_stateid(struct nfs4_state *state)
+ {
+ if (test_and_clear_bit(NFS_STATE_CHANGE_WAIT, &state->flags))
+- wake_up_all(&state->waitq);
++ wake_up_bit(&state->flags, NFS_STATE_CHANGE_WAIT);
+ }
+
+ static void nfs_state_log_out_of_order_open_stateid(struct nfs4_state *state,
+@@ -1519,7 +1519,9 @@ static void nfs_clear_open_stateid(struc
+ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
+ const nfs4_stateid *stateid, nfs4_stateid *freeme)
+ {
+- DEFINE_WAIT(wait);
++ struct wait_queue_head *wq_head = bit_waitqueue(&state->flags,
++ NFS_STATE_CHANGE_WAIT);
++ DEFINE_WAIT_BIT(wbq_entry, &state->flags, NFS_STATE_CHANGE_WAIT);
+ int status = 0;
+ for (;;) {
+
+@@ -1533,7 +1535,7 @@ static void nfs_set_open_stateid_locked(
+ if (!nfs4_has_session(NFS_SERVER(state->inode)->nfs_client))
+ break;
+
+- prepare_to_wait(&state->waitq, &wait, TASK_KILLABLE);
++ prepare_to_wait(wq_head, &wbq_entry.wq_entry, TASK_KILLABLE);
+ /*
+ * Ensure we process the state changes in the same order
+ * in which the server processed them by delaying the
+@@ -1549,7 +1551,7 @@ static void nfs_set_open_stateid_locked(
+ status = 0;
+ } else
+ status = -EINTR;
+- finish_wait(&state->waitq, &wait);
++ finish_wait(wq_head, &wbq_entry.wq_entry);
+ rcu_read_lock();
+ spin_lock(&state->owner->so_lock);
+ write_seqlock(&state->seqlock);
+--- a/fs/nfs/nfs4state.c
++++ b/fs/nfs/nfs4state.c
+@@ -658,7 +658,6 @@ nfs4_alloc_open_state(void)
+ INIT_LIST_HEAD(&state->lock_states);
+ spin_lock_init(&state->state_lock);
+ seqlock_init(&state->seqlock);
+- init_waitqueue_head(&state->waitq);
+ return state;
+ }
+
diff --git a/patches.suse/NFS-Don-t-interrupt-file-writeout-due-to-fatal-error.patch b/patches.suse/NFS-Don-t-interrupt-file-writeout-due-to-fatal-error.patch
new file mode 100644
index 0000000000..b741ee9d1e
--- /dev/null
+++ b/patches.suse/NFS-Don-t-interrupt-file-writeout-due-to-fatal-error.patch
@@ -0,0 +1,31 @@
+From: Trond Myklebust <trondmy@gmail.com>
+Date: Sun, 7 Apr 2019 13:59:02 -0400
+Subject: [PATCH] NFS: Don't interrupt file writeout due to fatal errors
+Git-commit: 14bebe3c90b326d2a0df78aed5e9de090c71d878
+Patch-mainline: v5.2
+References: git-fixes
+
+When flushing out dirty pages, the fact that we may hit fatal errors
+is not a reason to stop writeback. Those errors are reported through
+fsync(), not through the flush mechanism.
+
+Fixes: a6598813a4c5b ("NFS: Don't write back further requests if there...")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/write.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/nfs/write.c
++++ b/fs/nfs/write.c
+@@ -668,7 +668,7 @@ out:
+ return ret;
+ out_launder:
+ nfs_write_error_remove_page(req);
+- return ret;
++ return 0;
+ }
+
+ static int nfs_do_writepage(struct page *page, struct writeback_control *wbc,
diff --git a/patches.suse/NFS-Don-t-open-code-clearing-of-delegation-state.patch b/patches.suse/NFS-Don-t-open-code-clearing-of-delegation-state.patch
new file mode 100644
index 0000000000..1189f52713
--- /dev/null
+++ b/patches.suse/NFS-Don-t-open-code-clearing-of-delegation-state.patch
@@ -0,0 +1,75 @@
+From: Trond Myklebust <trondmy@gmail.com>
+Date: Wed, 5 Sep 2018 14:07:15 -0400
+Subject: [PATCH] NFS: Don't open code clearing of delegation state
+Git-commit: 9f0c5124f4a82503ee5d55c60b0b9c6afc3af68b
+Patch-mainline: v4.19
+References: git-fixes
+
+Add a helper for the case when the nfs4 open state has been set to use
+a delegation stateid, and we want to revert to using the open stateid.
+
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/nfs4proc.c | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -1605,6 +1605,14 @@ static void nfs_state_set_delegation(str
+ write_sequnlock(&state->seqlock);
+ }
+
++static void nfs_state_clear_delegation(struct nfs4_state *state)
++{
++ write_seqlock(&state->seqlock);
++ nfs4_stateid_copy(&state->stateid, &state->open_stateid);
++ clear_bit(NFS_DELEGATED_STATE, &state->flags);
++ write_sequnlock(&state->seqlock);
++}
++
+ static int update_open_stateid(struct nfs4_state *state,
+ const nfs4_stateid *open_stateid,
+ const nfs4_stateid *delegation,
+@@ -2076,10 +2084,7 @@ int nfs4_open_delegation_recall(struct n
+ if (IS_ERR(opendata))
+ return PTR_ERR(opendata);
+ nfs4_stateid_copy(&opendata->o_arg.u.delegation, stateid);
+- write_seqlock(&state->seqlock);
+- nfs4_stateid_copy(&state->stateid, &state->open_stateid);
+- write_sequnlock(&state->seqlock);
+- clear_bit(NFS_DELEGATED_STATE, &state->flags);
++ nfs_state_clear_delegation(state);
+ switch (type & (FMODE_READ|FMODE_WRITE)) {
+ case FMODE_READ|FMODE_WRITE:
+ case FMODE_WRITE:
+@@ -2525,10 +2530,7 @@ static void nfs_finish_clear_delegation_
+ const nfs4_stateid *stateid)
+ {
+ nfs_remove_bad_delegation(state->inode, stateid);
+- write_seqlock(&state->seqlock);
+- nfs4_stateid_copy(&state->stateid, &state->open_stateid);
+- write_sequnlock(&state->seqlock);
+- clear_bit(NFS_DELEGATED_STATE, &state->flags);
++ nfs_state_clear_delegation(state);
+ }
+
+ static void nfs40_clear_delegation_stateid(struct nfs4_state *state)
+@@ -2596,13 +2598,14 @@ static void nfs41_check_delegation_state
+ delegation = rcu_dereference(NFS_I(state->inode)->delegation);
+ if (delegation == NULL) {
+ rcu_read_unlock();
++ nfs_state_clear_delegation(state);
+ return;
+ }
+
+ nfs4_stateid_copy(&stateid, &delegation->stateid);
+ if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) {
+ rcu_read_unlock();
+- nfs_finish_clear_delegation_stateid(state, &stateid);
++ nfs_state_clear_delegation(state);
+ return;
+ }
+
diff --git a/patches.suse/NFS-Ensure-O_DIRECT-reports-an-error-if-the-bytes-re.patch b/patches.suse/NFS-Ensure-O_DIRECT-reports-an-error-if-the-bytes-re.patch
new file mode 100644
index 0000000000..b193ac05f5
--- /dev/null
+++ b/patches.suse/NFS-Ensure-O_DIRECT-reports-an-error-if-the-bytes-re.patch
@@ -0,0 +1,84 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Mon, 12 Aug 2019 18:04:36 -0400
+Subject: [PATCH] NFS: Ensure O_DIRECT reports an error if the bytes
+ read/written is 0
+Git-commit: eb2c50da9e256dbbb3ff27694440e4c1900cfef8
+Patch-mainline: v5.3
+References: git-fixes
+
+If the attempt to resend the I/O results in no bytes being read/written,
+we must ensure that we report the error.
+
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Fixes: 0a00b77b331a ("nfs: mirroring support for direct io")
+Cc: stable@vger.kernel.org # v3.20+
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/direct.c | 27 ++++++++++++++++++---------
+ fs/nfs/pagelist.c | 1 +
+ 2 files changed, 19 insertions(+), 9 deletions(-)
+
+--- a/fs/nfs/direct.c
++++ b/fs/nfs/direct.c
+@@ -397,15 +397,21 @@ static void nfs_direct_read_completion(s
+ unsigned long bytes = 0;
+ struct nfs_direct_req *dreq = hdr->dreq;
+
+- if (test_bit(NFS_IOHDR_REDO, &hdr->flags))
+- goto out_put;
+-
+ spin_lock(&dreq->lock);
+- if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) && (hdr->good_bytes == 0))
++ if (test_bit(NFS_IOHDR_ERROR, &hdr->flags))
+ dreq->error = hdr->error;
+- else
++
++ if (test_bit(NFS_IOHDR_REDO, &hdr->flags)) {
++ spin_unlock(&dreq->lock);
++ goto out_put;
++ }
++
++ if (hdr->good_bytes != 0)
+ nfs_direct_good_bytes(dreq, hdr);
+
++ if (test_bit(NFS_IOHDR_EOF, &hdr->flags))
++ dreq->error = 0;
++
+ spin_unlock(&dreq->lock);
+
+ while (!list_empty(&hdr->pages)) {
+@@ -768,16 +774,19 @@ static void nfs_direct_write_completion(
+ bool request_commit = false;
+ struct nfs_page *req = nfs_list_entry(hdr->pages.next);
+
+- if (test_bit(NFS_IOHDR_REDO, &hdr->flags))
+- goto out_put;
+-
+ nfs_init_cinfo_from_dreq(&cinfo, dreq);
+
+ spin_lock(&dreq->lock);
+
+ if (test_bit(NFS_IOHDR_ERROR, &hdr->flags))
+ dreq->error = hdr->error;
+- if (dreq->error == 0) {
++
++ if (test_bit(NFS_IOHDR_REDO, &hdr->flags)) {
++ spin_unlock(&dreq->lock);
++ goto out_put;
++ }
++
++ if (hdr->good_bytes != 0) {
+ nfs_direct_good_bytes(dreq, hdr);
+ if (nfs_write_need_commit(hdr)) {
+ if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES)
+--- a/fs/nfs/pagelist.c
++++ b/fs/nfs/pagelist.c
+@@ -1278,6 +1278,7 @@ int nfs_pageio_resend(struct nfs_pageio_
+ if (!list_empty(&pages)) {
+ int err = desc->pg_error < 0 ? desc->pg_error : -EIO;
+ hdr->completion_ops->error_cleanup(&pages);
++ nfs_set_pgio_error(hdr, err, hdr->io_start);
+ return err;
+ }
+ return 0;
diff --git a/patches.suse/NFS-Fix-regression-whereby-fscache-errors-are-appear.patch b/patches.suse/NFS-Fix-regression-whereby-fscache-errors-are-appear.patch
new file mode 100644
index 0000000000..d6e1c5272b
--- /dev/null
+++ b/patches.suse/NFS-Fix-regression-whereby-fscache-errors-are-appear.patch
@@ -0,0 +1,78 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Sat, 3 Aug 2019 13:39:24 -0400
+Subject: [PATCH] NFS: Fix regression whereby fscache errors are appearing on
+ 'nofsc' mounts
+Git-commit: dea1bb35c5f35e0577cfc61f79261d80b8715221
+Patch-mainline: v5.3
+References: git-fixes
+
+People are reporing seeing fscache errors being reported concerning
+duplicate cookies even in cases where they are not setting up fscache
+at all. The rule needs to be that if fscache is not enabled, then it
+should have no side effects at all.
+
+To ensure this is the case, we disable fscache completely on all superblocks
+for which the 'fsc' mount option was not set. In order to avoid issues
+with '-oremount', we also disable the ability to turn fscache on via
+remount.
+
+Fixes: f1fe29b4a02d ("NFS: Use i_writecount to control whether...")
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=200145
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: Steve Dickson <steved@redhat.com>
+Cc: David Howells <dhowells@redhat.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/fscache.c | 7 ++++++-
+ fs/nfs/fscache.h | 2 +-
+ fs/nfs/super.c | 1 +
+ 3 files changed, 8 insertions(+), 2 deletions(-)
+
+--- a/fs/nfs/fscache.c
++++ b/fs/nfs/fscache.c
+@@ -71,6 +71,10 @@ void nfs_fscache_get_super_cookie(struct
+ struct rb_node **p, *parent;
+ int diff;
+
++ nfss->fscache_key = NULL;
++ nfss->fscache = NULL;
++ if (!(nfss->options & NFS_OPTION_FSCACHE))
++ return;
+ if (!uniq) {
+ uniq = "";
+ ulen = 1;
+@@ -180,10 +184,11 @@ void nfs_fscache_release_super_cookie(st
+ */
+ void nfs_fscache_init_inode(struct inode *inode)
+ {
++ struct nfs_server *nfss = NFS_SERVER(inode);
+ struct nfs_inode *nfsi = NFS_I(inode);
+
+ nfsi->fscache = NULL;
+- if (!S_ISREG(inode->i_mode))
++ if (!(nfss->fscache && S_ISREG(inode->i_mode)))
+ return;
+ nfsi->fscache = fscache_acquire_cookie(NFS_SB(inode->i_sb)->fscache,
+ &nfs_fscache_inode_object_def,
+--- a/fs/nfs/fscache.h
++++ b/fs/nfs/fscache.h
+@@ -171,7 +171,7 @@ static inline void nfs_fscache_wait_on_i
+ */
+ static inline const char *nfs_server_fscache_state(struct nfs_server *server)
+ {
+- if (server->fscache && (server->options & NFS_OPTION_FSCACHE))
++ if (server->fscache)
+ return "yes";
+ return "no ";
+ }
+--- a/fs/nfs/super.c
++++ b/fs/nfs/super.c
+@@ -2250,6 +2250,7 @@ nfs_compare_remount_data(struct nfs_serv
+ data->acdirmin != nfss->acdirmin / HZ ||
+ data->acdirmax != nfss->acdirmax / HZ ||
+ data->timeo != (10U * nfss->client->cl_timeout->to_initval / HZ) ||
++ (data->options & NFS_OPTION_FSCACHE) != (nfss->options & NFS_OPTION_FSCACHE) ||
+ data->nfs_server.port != nfss->port ||
+ data->nfs_server.addrlen != nfss->nfs_client->cl_addrlen ||
+ !rpc_cmp_addr((struct sockaddr *)&data->nfs_server.address,
diff --git a/patches.suse/NFS-Forbid-setting-AF_INET6-to-struct-sockaddr_in-si.patch b/patches.suse/NFS-Forbid-setting-AF_INET6-to-struct-sockaddr_in-si.patch
new file mode 100644
index 0000000000..270fdc5b1a
--- /dev/null
+++ b/patches.suse/NFS-Forbid-setting-AF_INET6-to-struct-sockaddr_in-si.patch
@@ -0,0 +1,42 @@
+From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
+Date: Sat, 30 Mar 2019 10:21:07 +0900
+Subject: [PATCH] NFS: Forbid setting AF_INET6 to "struct
+ sockaddr_in"->sin_family.
+Git-commit: 7c2bd9a39845bfb6d72ddb55ce737650271f6f96
+Patch-mainline: v5.1
+References: git-fixes
+
+syzbot is reporting uninitialized value at rpc_sockaddr2uaddr() [1]. This
+is because syzbot is setting AF_INET6 to "struct sockaddr_in"->sin_family
+(which is embedded into user-visible "struct nfs_mount_data" structure)
+despite nfs23_validate_mount_data() cannot pass sizeof(struct sockaddr_in6)
+bytes of AF_INET6 address to rpc_sockaddr2uaddr().
+
+Since "struct nfs_mount_data" structure is user-visible, we can't change
+"struct nfs_mount_data" to use "struct sockaddr_storage". Therefore,
+assuming that everybody is using AF_INET family when passing address via
+"struct nfs_mount_data"->addr, reject if its sin_family is not AF_INET.
+
+[1] https://syzkaller.appspot.com/bug?id=599993614e7cbbf66bc2656a919ab2a95fb5d75c
+
+Reported-by: syzbot <syzbot+047a11c361b872896a4f@syzkaller.appspotmail.com>
+Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/super.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/nfs/super.c
++++ b/fs/nfs/super.c
+@@ -2063,7 +2063,8 @@ static int nfs23_validate_mount_data(voi
+ memcpy(sap, &data->addr, sizeof(data->addr));
+ args->nfs_server.addrlen = sizeof(data->addr);
+ args->nfs_server.port = ntohs(data->addr.sin_port);
+- if (!nfs_verify_server_address(sap))
++ if (sap->sa_family != AF_INET ||
++ !nfs_verify_server_address(sap))
+ goto out_no_address;
+
+ if (!(data->flags & NFS_MOUNT_TCP))
diff --git a/patches.suse/NFS-Refactor-nfs_lookup_revalidate.patch b/patches.suse/NFS-Refactor-nfs_lookup_revalidate.patch
new file mode 100644
index 0000000000..12bc6b0a20
--- /dev/null
+++ b/patches.suse/NFS-Refactor-nfs_lookup_revalidate.patch
@@ -0,0 +1,293 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Fri, 28 Sep 2018 09:04:05 -0400
+Subject: [PATCH] NFS: Refactor nfs_lookup_revalidate()
+Git-commit: 5ceb9d7fdaaf6d8ced6cd7861cf1deb9cd93fa47
+Patch-mainline: v4.20
+References: git-fixes
+
+Refactor the code in nfs_lookup_revalidate() as a stepping stone towards
+optimising and fixing nfs4_lookup_revalidate().
+
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/dir.c | 222 +++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 126 insertions(+), 96 deletions(-)
+
+--- a/fs/nfs/dir.c
++++ b/fs/nfs/dir.c
+@@ -1059,6 +1059,100 @@ int nfs_neg_need_reval(struct inode *dir
+ return !nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU);
+ }
+
++static int
++nfs_lookup_revalidate_done(struct inode *dir, struct dentry *dentry,
++ struct inode *inode, int error)
++{
++ switch (error) {
++ case 1:
++ dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is valid\n",
++ __func__, dentry);
++ return 1;
++ case 0:
++ nfs_mark_for_revalidate(dir);
++ if (inode && S_ISDIR(inode->i_mode)) {
++ /* Purge readdir caches. */
++ nfs_zap_caches(inode);
++ /*
++ * We can't d_drop the root of a disconnected tree:
++ * its d_hash is on the s_anon list and d_drop() would hide
++ * it from shrink_dcache_for_unmount(), leading to busy
++ * inodes on unmount and further oopses.
++ */
++ if (IS_ROOT(dentry))
++ return 1;
++ }
++ dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n",
++ __func__, dentry);
++ return 0;
++ }
++ dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) lookup returned error %d\n",
++ __func__, dentry, error);
++ return error;
++}
++
++static int
++nfs_lookup_revalidate_negative(struct inode *dir, struct dentry *dentry,
++ unsigned int flags)
++{
++ int ret = 1;
++ if (nfs_neg_need_reval(dir, dentry, flags)) {
++ if (flags & LOOKUP_RCU)
++ return -ECHILD;
++ ret = 0;
++ }
++ return nfs_lookup_revalidate_done(dir, dentry, NULL, ret);
++}
++
++static int
++nfs_lookup_revalidate_delegated(struct inode *dir, struct dentry *dentry,
++ struct inode *inode)
++{
++ nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
++ return nfs_lookup_revalidate_done(dir, dentry, inode, 1);
++}
++
++static int
++nfs_lookup_revalidate_dentry(struct inode *dir, struct dentry *dentry,
++ struct inode *inode)
++{
++ struct nfs_fh *fhandle;
++ struct nfs_fattr *fattr;
++ struct nfs4_label *label;
++ int ret;
++
++ ret = -ENOMEM;
++ fhandle = nfs_alloc_fhandle();
++ fattr = nfs_alloc_fattr();
++ label = nfs4_label_alloc(NFS_SERVER(inode), GFP_KERNEL);
++ if (fhandle == NULL || fattr == NULL || IS_ERR(label))
++ goto out;
++
++ ret = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, label);
++ if (ret < 0) {
++ if (ret == -ESTALE || ret == -ENOENT)
++ ret = 0;
++ goto out;
++ }
++ ret = 0;
++ if (nfs_compare_fh(NFS_FH(inode), fhandle))
++ goto out;
++ if (nfs_refresh_inode(inode, fattr) < 0)
++ goto out;
++
++ nfs_setsecurity(inode, fattr, label);
++ nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
++
++ /* set a readdirplus hint that we had a cache miss */
++ nfs_force_use_readdirplus(dir);
++ ret = 1;
++out:
++ nfs_free_fattr(fattr);
++ nfs_free_fhandle(fhandle);
++ nfs4_label_free(label);
++ return nfs_lookup_revalidate_done(dir, dentry, inode, ret);
++}
++
+ /*
+ * This is called every time the dcache has a lookup hit,
+ * and we should check whether we can really trust that
+@@ -1070,58 +1164,36 @@ int nfs_neg_need_reval(struct inode *dir
+ * If the parent directory is seen to have changed, we throw out the
+ * cached dentry and do a new lookup.
+ */
+-static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
++static int
++nfs_do_lookup_revalidate(struct inode *dir, struct dentry *dentry,
++ unsigned int flags)
+ {
+- struct inode *dir;
+ struct inode *inode;
+- struct dentry *parent;
+- struct nfs_fh *fhandle = NULL;
+- struct nfs_fattr *fattr = NULL;
+- struct nfs4_label *label = NULL;
+ int error;
+
+- if (flags & LOOKUP_RCU) {
+- parent = READ_ONCE(dentry->d_parent);
+- dir = d_inode_rcu(parent);
+- if (!dir)
+- return -ECHILD;
+- } else {
+- parent = dget_parent(dentry);
+- dir = d_inode(parent);
+- }
+ nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE);
+ inode = d_inode(dentry);
+
+- if (!inode) {
+- if (nfs_neg_need_reval(dir, dentry, flags)) {
+- if (flags & LOOKUP_RCU)
+- return -ECHILD;
+- goto out_bad;
+- }
+- goto out_valid;
+- }
++ if (!inode)
++ return nfs_lookup_revalidate_negative(dir, dentry, flags);
+
+ if (is_bad_inode(inode)) {
+- if (flags & LOOKUP_RCU)
+- return -ECHILD;
+ dfprintk(LOOKUPCACHE, "%s: %pd2 has dud inode\n",
+ __func__, dentry);
+ goto out_bad;
+ }
+
+ if (NFS_PROTO(dir)->have_delegation(inode, FMODE_READ))
+- goto out_set_verifier;
++ return nfs_lookup_revalidate_delegated(dir, dentry, inode);
+
+ /* Force a full look up iff the parent directory has changed */
+ if (!nfs_is_exclusive_create(dir, flags) &&
+ nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU)) {
+ error = nfs_lookup_verify_inode(inode, flags);
+ if (error) {
+- if (flags & LOOKUP_RCU)
+- return -ECHILD;
+ if (error == -ESTALE)
+- goto out_zap_parent;
+- goto out_error;
++ nfs_zap_caches(dir);
++ goto out_bad;
+ }
+ nfs_advise_use_readdirplus(dir);
+ goto out_valid;
+@@ -1133,81 +1205,39 @@ static int nfs_lookup_revalidate(struct
+ if (NFS_STALE(inode))
+ goto out_bad;
+
+- error = -ENOMEM;
+- fhandle = nfs_alloc_fhandle();
+- fattr = nfs_alloc_fattr();
+- if (fhandle == NULL || fattr == NULL)
+- goto out_error;
+-
+- label = nfs4_label_alloc(NFS_SERVER(inode), GFP_NOWAIT);
+- if (IS_ERR(label))
+- goto out_error;
+-
+ trace_nfs_lookup_revalidate_enter(dir, dentry, flags);
+- error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, label);
++ error = nfs_lookup_revalidate_dentry(dir, dentry, inode);
+ trace_nfs_lookup_revalidate_exit(dir, dentry, flags, error);
+- if (error == -ESTALE || error == -ENOENT)
+- goto out_bad;
+- if (error)
+- goto out_error;
+- if (nfs_compare_fh(NFS_FH(inode), fhandle))
+- goto out_bad;
+- if ((error = nfs_refresh_inode(inode, fattr)) != 0)
+- goto out_bad;
+-
+- nfs_setsecurity(inode, fattr, label);
+-
+- nfs_free_fattr(fattr);
+- nfs_free_fhandle(fhandle);
+- nfs4_label_free(label);
++ return error;
++out_valid:
++ return nfs_lookup_revalidate_done(dir, dentry, inode, 1);
++out_bad:
++ if (flags & LOOKUP_RCU)
++ return -ECHILD;
++ return nfs_lookup_revalidate_done(dir, dentry, inode, 0);
++}
+
+- /* set a readdirplus hint that we had a cache miss */
+- nfs_force_use_readdirplus(dir);
++static int
++nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
++{
++ struct dentry *parent;
++ struct inode *dir;
++ int ret;
+
+-out_set_verifier:
+- nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
+- out_valid:
+ if (flags & LOOKUP_RCU) {
++ parent = READ_ONCE(dentry->d_parent);
++ dir = d_inode_rcu(parent);
++ if (!dir)
++ return -ECHILD;
++ ret = nfs_do_lookup_revalidate(dir, dentry, flags);
+ if (parent != READ_ONCE(dentry->d_parent))
+ return -ECHILD;
+- } else
++ } else {
++ parent = dget_parent(dentry);
++ ret = nfs_do_lookup_revalidate(d_inode(parent), dentry, flags);
+ dput(parent);
+- dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is valid\n",
+- __func__, dentry);
+- return 1;
+-out_zap_parent:
+- nfs_zap_caches(dir);
+- out_bad:
+- WARN_ON(flags & LOOKUP_RCU);
+- nfs_free_fattr(fattr);
+- nfs_free_fhandle(fhandle);
+- nfs4_label_free(label);
+- nfs_mark_for_revalidate(dir);
+- if (inode && S_ISDIR(inode->i_mode)) {
+- /* Purge readdir caches. */
+- nfs_zap_caches(inode);
+- /*
+- * We can't d_drop the root of a disconnected tree:
+- * its d_hash is on the s_anon list and d_drop() would hide
+- * it from shrink_dcache_for_unmount(), leading to busy
+- * inodes on unmount and further oopses.
+- */
+- if (IS_ROOT(dentry))
+- goto out_valid;
+ }
+- dput(parent);
+- dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n",
+- __func__, dentry);
+- return 0;
+-out_error:
+- WARN_ON(flags & LOOKUP_RCU);
+- nfs_free_fattr(fattr);
+- nfs_free_fhandle(fhandle);
+- nfs4_label_free(label);
+- dput(parent);
+- dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) lookup returned error %d\n",
+- __func__, dentry, error);
+- return error;
++ return ret;
+ }
+
+ /*
diff --git a/patches.suse/NFS-Remove-redundant-semicolon.patch b/patches.suse/NFS-Remove-redundant-semicolon.patch
new file mode 100644
index 0000000000..106bbb97f5
--- /dev/null
+++ b/patches.suse/NFS-Remove-redundant-semicolon.patch
@@ -0,0 +1,29 @@
+From: zhangliguang <zhangliguang@linux.alibaba.com>
+Date: Tue, 12 Feb 2019 09:38:33 +0800
+Subject: [PATCH] NFS: Remove redundant semicolon
+Git-commit: 42f72cf368c502c435af4e206e26d651cfb7d9ad
+Patch-mainline: v5.1
+References: git-fixes
+
+This removes redundant semicolon for ending code.
+
+Fixes: c7944ebb9ce9 ("NFSv4: Fix lookup revalidate of regular files")
+Signed-off-by: Liguang Zhang <zhangliguang@linux.alibaba.com>
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/dir.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/nfs/dir.c
++++ b/fs/nfs/dir.c
+@@ -1633,7 +1633,7 @@ nfs4_do_lookup_revalidate(struct inode *
+ reval_dentry:
+ if (flags & LOOKUP_RCU)
+ return -ECHILD;
+- return nfs_lookup_revalidate_dentry(dir, dentry, inode);;
++ return nfs_lookup_revalidate_dentry(dir, dentry, inode);
+
+ full_reval:
+ return nfs_do_lookup_revalidate(dir, dentry, flags);
diff --git a/patches.suse/NFS4-Fix-v4.0-client-state-corruption-when-mount.patch b/patches.suse/NFS4-Fix-v4.0-client-state-corruption-when-mount.patch
new file mode 100644
index 0000000000..bb622e9f65
--- /dev/null
+++ b/patches.suse/NFS4-Fix-v4.0-client-state-corruption-when-mount.patch
@@ -0,0 +1,45 @@
+From: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
+Date: Mon, 6 May 2019 11:57:03 +0800
+Subject: [PATCH] NFS4: Fix v4.0 client state corruption when mount
+Git-commit: f02f3755dbd14fb935d24b14650fff9ba92243b8
+Patch-mainline: v5.2
+References: git-fixes
+
+stat command with soft mount never return after server is stopped.
+
+When alloc a new client, the state of the client will be set to
+NFS4CLNT_LEASE_EXPIRED.
+
+When the server is stopped, the state manager will work, and accord
+the state to recover. But the state is NFS4CLNT_LEASE_EXPIRED, it
+will drain the slot table and lead other task to wait queue, until
+the client recovered. Then the stat command is hung.
+
+When discover server trunking, the client will renew the lease,
+but check the client state, it lead the client state corruption.
+
+So, we need to call state manager to recover it when detect server
+ip trunking.
+
+Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/nfs4state.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/fs/nfs/nfs4state.c
++++ b/fs/nfs/nfs4state.c
+@@ -143,6 +143,10 @@ int nfs40_discover_server_trunking(struc
+ /* Sustain the lease, even if it's empty. If the clientid4
+ * goes stale it's of no use for trunking discovery. */
+ nfs4_schedule_state_renewal(*result);
++
++ /* If the client state need to recover, do it. */
++ if (clp->cl_state)
++ nfs4_schedule_state_manager(clp);
+ }
+ out:
+ return status;
diff --git a/patches.suse/NFSv4-Check-the-return-value-of-update_open_stateid.patch b/patches.suse/NFSv4-Check-the-return-value-of-update_open_stateid.patch
new file mode 100644
index 0000000000..1c26a33187
--- /dev/null
+++ b/patches.suse/NFSv4-Check-the-return-value-of-update_open_stateid.patch
@@ -0,0 +1,49 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Mon, 29 Jul 2019 18:25:00 +0100
+Subject: [PATCH] NFSv4: Check the return value of update_open_stateid()
+Git-commit: e3c8dc761ead061da2220ee8f8132f729ac3ddfe
+Patch-mainline: v5.3
+References: git-fixes
+
+Ensure that we always check the return value of update_open_stateid()
+so that we can retry if the update of local state failed. This fixes
+infinite looping on state recovery.
+
+Fixes: e23008ec81ef3 ("NFSv4 reduce attribute requests for open reclaim")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: stable@vger.kernel.org # v3.7+
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/nfs4proc.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -1814,8 +1814,9 @@ _nfs4_opendata_reclaim_to_nfs4_state(str
+ if (data->o_res.delegation_type != 0)
+ nfs4_opendata_check_deleg(data, state);
+ update:
+- update_open_stateid(state, &data->o_res.stateid, NULL,
+- data->o_arg.fmode);
++ if (!update_open_stateid(state, &data->o_res.stateid,
++ NULL, data->o_arg.fmode))
++ return ERR_PTR(-EAGAIN);
+ atomic_inc(&state->count);
+
+ return state;
+@@ -1847,9 +1848,11 @@ _nfs4_opendata_to_nfs4_state(struct nfs4
+ goto err_put_inode;
+ if (data->o_res.delegation_type != 0)
+ nfs4_opendata_check_deleg(data, state);
+- update_open_stateid(state, &data->o_res.stateid, NULL,
+- data->o_arg.fmode);
+- iput(inode);
++ if (!update_open_stateid(state, &data->o_res.stateid,
++ NULL, data->o_arg.fmode)) {
++ nfs4_put_open_state(state);
++ state = ERR_PTR(-EAGAIN);
++ }
+ out:
+ nfs_release_seqid(data->o_arg.seqid);
+ return state;
diff --git a/patches.suse/NFSv4-Fix-OPEN-CLOSE-race.patch b/patches.suse/NFSv4-Fix-OPEN-CLOSE-race.patch
new file mode 100644
index 0000000000..7765e28ce3
--- /dev/null
+++ b/patches.suse/NFSv4-Fix-OPEN-CLOSE-race.patch
@@ -0,0 +1,335 @@
+From: Trond Myklebust <trond.myklebust@primarydata.com>
+Date: Mon, 6 Nov 2017 15:28:01 -0500
+Subject: [PATCH] NFSv4: Fix OPEN / CLOSE race
+Git-commit: c9399f21c215453b414702758b8c4b7d66605eac
+Patch-mainline: v4.15
+References: git-fixes
+
+Ben Coddington has noted the following race between OPEN and CLOSE
+on a single client.
+
+Process 1 Process 2 Server
+========= ========= ======
+
+1) OPEN file
+2) OPEN file
+3) Process OPEN (1) seqid=1
+4) Process OPEN (2) seqid=2
+5) Reply OPEN (2)
+6) Receive reply (2)
+7) new stateid, seqid=2
+
+8) CLOSE file, using
+ stateid w/ seqid=2
+9) Reply OPEN (1)
+10( Process CLOSE (8)
+11) Reply CLOSE (8)
+12) Forget stateid
+ file closed
+
+13) Receive reply (7)
+14) Forget stateid
+ file closed.
+
+15) Receive reply (1).
+16) New stateid seqid=1
+ is really the same
+ stateid that was
+ closed.
+
+Iow: the reply to the first OPEN is delayed. Since "Process 2" does
+not wait before closing the file, and it does not cache the closed
+stateid, then when the delayed reply is finally received, it is treated
+as setting up a new stateid by the client.
+
+The fix is to ensure that the client processes the OPEN and CLOSE calls
+in the same order in which the server processed them.
+
+This commit ensures that we examine the seqid of the stateid
+returned by OPEN. If it is a new stateid, we assume the seqid
+must be equal to the value 1, and that each state transition
+increments the seqid value by 1 (See RFC7530, Section 9.1.4.2,
+and RFC5661, Section 8.2.2).
+
+If the tracker sees that an OPEN returns with a seqid that is greater
+than the cached seqid + 1, then it bumps a flag to ensure that the
+caller waits for the RPCs carrying the missing seqids to complete.
+
+Note that there can still be pathologies where the server crashes before
+it can even send us the missing seqids. Since the OPEN call is still
+holding a slot when it waits here, that could cause the recovery to
+stall forever. To avoid that, we time out after a 5 second wait.
+
+Reported-by: Benjamin Coddington <bcodding@redhat.com>
+Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/nfs4_fs.h | 3 +
+ fs/nfs/nfs4proc.c | 154 ++++++++++++++++++++++++++++++++++++++++-------------
+ fs/nfs/nfs4state.c | 1
+ 3 files changed, 123 insertions(+), 35 deletions(-)
+
+--- a/fs/nfs/nfs4_fs.h
++++ b/fs/nfs/nfs4_fs.h
+@@ -161,6 +161,7 @@ enum {
+ NFS_STATE_POSIX_LOCKS, /* Posix locks are supported */
+ NFS_STATE_RECOVERY_FAILED, /* OPEN stateid state recovery failed */
+ NFS_STATE_MAY_NOTIFY_LOCK, /* server may CB_NOTIFY_LOCK */
++ NFS_STATE_CHANGE_WAIT, /* A state changing operation is outstanding */
+ };
+
+ struct nfs4_state {
+@@ -184,6 +185,8 @@ struct nfs4_state {
+ unsigned int n_rdwr; /* Number of read/write references */
+ fmode_t state; /* State on the server (R,W, or RW) */
+ atomic_t count;
++
++ wait_queue_head_t waitq;
+ };
+
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -1396,6 +1396,25 @@ static bool nfs_open_stateid_recover_ope
+ }
+ #endif /* CONFIG_NFS_V4_1 */
+
++static void nfs_state_log_update_open_stateid(struct nfs4_state *state)
++{
++ if (test_and_clear_bit(NFS_STATE_CHANGE_WAIT, &state->flags))
++ wake_up_all(&state->waitq);
++}
++
++static void nfs_state_log_out_of_order_open_stateid(struct nfs4_state *state,
++ const nfs4_stateid *stateid)
++{
++ u32 state_seqid = be32_to_cpu(state->open_stateid.seqid);
++ u32 stateid_seqid = be32_to_cpu(stateid->seqid);
++
++ if (stateid_seqid == state_seqid + 1U ||
++ (stateid_seqid == 1U && state_seqid == 0xffffffffU))
++ nfs_state_log_update_open_stateid(state);
++ else
++ set_bit(NFS_STATE_CHANGE_WAIT, &state->flags);
++}
++
+ static void nfs_test_and_clear_all_open_stateid(struct nfs4_state *state)
+ {
+ struct nfs_client *clp = state->owner->so_server->nfs_client;
+@@ -1411,18 +1430,32 @@ static void nfs_test_and_clear_all_open_
+ nfs4_state_mark_reclaim_nograce(clp, state);
+ }
+
++/*
++ * Check for whether or not the caller may update the open stateid
++ * to the value passed in by stateid.
++ *
++ * Note: This function relies heavily on the server implementing
++ * RFC7530 Section 9.1.4.2, and RFC5661 Section 8.2.2
++ * correctly.
++ * i.e. The stateid seqids have to be initialised to 1, and
++ * are then incremented on every state transition.
++ */
+ static bool nfs_need_update_open_stateid(struct nfs4_state *state,
+- const nfs4_stateid *stateid, nfs4_stateid *freeme)
++ const nfs4_stateid *stateid)
+ {
+- if (test_and_set_bit(NFS_OPEN_STATE, &state->flags) == 0)
+- return true;
+- if (!nfs4_stateid_match_other(stateid, &state->open_stateid)) {
+- nfs4_stateid_copy(freeme, &state->open_stateid);
+- nfs_test_and_clear_all_open_stateid(state);
++ if (test_bit(NFS_OPEN_STATE, &state->flags) == 0 ||
++ !nfs4_stateid_match_other(stateid, &state->open_stateid)) {
++ if (stateid->seqid == cpu_to_be32(1))
++ nfs_state_log_update_open_stateid(state);
++ else
++ set_bit(NFS_STATE_CHANGE_WAIT, &state->flags);
+ return true;
+ }
+- if (nfs4_stateid_is_newer(stateid, &state->open_stateid))
++
++ if (nfs4_stateid_is_newer(stateid, &state->open_stateid)) {
++ nfs_state_log_out_of_order_open_stateid(state, stateid);
+ return true;
++ }
+ return false;
+ }
+
+@@ -1461,11 +1494,13 @@ static void nfs_clear_open_stateid_locke
+ if (nfs4_stateid_match_other(stateid, &state->open_stateid) &&
+ !nfs4_stateid_is_newer(stateid, &state->open_stateid)) {
+ nfs_resync_open_stateid_locked(state);
+- return;
++ goto out;
+ }
+ if (test_bit(NFS_DELEGATED_STATE, &state->flags) == 0)
+ nfs4_stateid_copy(&state->stateid, stateid);
+ nfs4_stateid_copy(&state->open_stateid, stateid);
++out:
++ nfs_state_log_update_open_stateid(state);
+ }
+
+ static void nfs_clear_open_stateid(struct nfs4_state *state,
+@@ -1482,29 +1517,57 @@ static void nfs_clear_open_stateid(struc
+ }
+
+ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
+- const nfs4_stateid *stateid, fmode_t fmode,
+- nfs4_stateid *freeme)
++ const nfs4_stateid *stateid, nfs4_stateid *freeme)
+ {
+- switch (fmode) {
+- case FMODE_READ:
+- set_bit(NFS_O_RDONLY_STATE, &state->flags);
++ DEFINE_WAIT(wait);
++ int status = 0;
++ for (;;) {
++
++ if (!nfs_need_update_open_stateid(state, stateid))
++ return;
++ if (!test_bit(NFS_STATE_CHANGE_WAIT, &state->flags))
++ break;
++ if (status)
+ break;
+- case FMODE_WRITE:
+- set_bit(NFS_O_WRONLY_STATE, &state->flags);
++ /* Rely on seqids for serialisation with NFSv4.0 */
++ if (!nfs4_has_session(NFS_SERVER(state->inode)->nfs_client))
+ break;
+- case FMODE_READ|FMODE_WRITE:
+- set_bit(NFS_O_RDWR_STATE, &state->flags);
++
++ prepare_to_wait(&state->waitq, &wait, TASK_KILLABLE);
++ /*
++ * Ensure we process the state changes in the same order
++ * in which the server processed them by delaying the
++ * update of the stateid until we are in sequence.
++ */
++ write_sequnlock(&state->seqlock);
++ spin_unlock(&state->owner->so_lock);
++ rcu_read_unlock();
++ if (!signal_pending(current)) {
++ if (schedule_timeout(5*HZ) == 0)
++ status = -EAGAIN;
++ else
++ status = 0;
++ } else
++ status = -EINTR;
++ finish_wait(&state->waitq, &wait);
++ rcu_read_lock();
++ spin_lock(&state->owner->so_lock);
++ write_seqlock(&state->seqlock);
+ }
+- if (!nfs_need_update_open_stateid(state, stateid, freeme))
+- return;
++
++ if (!nfs4_stateid_match_other(stateid, &state->open_stateid)) {
++ nfs4_stateid_copy(freeme, &state->open_stateid);
++ nfs_test_and_clear_all_open_stateid(state);
++ }
++
+ if (test_bit(NFS_DELEGATED_STATE, &state->flags) == 0)
+ nfs4_stateid_copy(&state->stateid, stateid);
+ nfs4_stateid_copy(&state->open_stateid, stateid);
++ nfs_state_log_update_open_stateid(state);
+ }
+
+-static void __update_open_stateid(struct nfs4_state *state,
++static void nfs_state_set_open_stateid(struct nfs4_state *state,
+ const nfs4_stateid *open_stateid,
+- const nfs4_stateid *deleg_stateid,
+ fmode_t fmode,
+ nfs4_stateid *freeme)
+ {
+@@ -1512,17 +1575,34 @@ static void __update_open_stateid(struct
+ * Protect the call to nfs4_state_set_mode_locked and
+ * serialise the stateid update
+ */
+- spin_lock(&state->owner->so_lock);
+ write_seqlock(&state->seqlock);
+- if (deleg_stateid != NULL) {
+- nfs4_stateid_copy(&state->stateid, deleg_stateid);
+- set_bit(NFS_DELEGATED_STATE, &state->flags);
++ nfs_set_open_stateid_locked(state, open_stateid, freeme);
++ switch (fmode) {
++ case FMODE_READ:
++ set_bit(NFS_O_RDONLY_STATE, &state->flags);
++ break;
++ case FMODE_WRITE:
++ set_bit(NFS_O_WRONLY_STATE, &state->flags);
++ break;
++ case FMODE_READ|FMODE_WRITE:
++ set_bit(NFS_O_RDWR_STATE, &state->flags);
+ }
+- if (open_stateid != NULL)
+- nfs_set_open_stateid_locked(state, open_stateid, fmode, freeme);
++ set_bit(NFS_OPEN_STATE, &state->flags);
++ write_sequnlock(&state->seqlock);
++}
++
++static void nfs_state_set_delegation(struct nfs4_state *state,
++ const nfs4_stateid *deleg_stateid,
++ fmode_t fmode)
++{
++ /*
++ * Protect the call to nfs4_state_set_mode_locked and
++ * serialise the stateid update
++ */
++ write_seqlock(&state->seqlock);
++ nfs4_stateid_copy(&state->stateid, deleg_stateid);
++ set_bit(NFS_DELEGATED_STATE, &state->flags);
+ write_sequnlock(&state->seqlock);
+- update_open_stateflags(state, fmode);
+- spin_unlock(&state->owner->so_lock);
+ }
+
+ static int update_open_stateid(struct nfs4_state *state,
+@@ -1540,6 +1620,12 @@ static int update_open_stateid(struct nf
+ fmode &= (FMODE_READ|FMODE_WRITE);
+
+ rcu_read_lock();
++ spin_lock(&state->owner->so_lock);
++ if (open_stateid != NULL) {
++ nfs_state_set_open_stateid(state, open_stateid, fmode, &freeme);
++ ret = 1;
++ }
++
+ deleg_cur = rcu_dereference(nfsi->delegation);
+ if (deleg_cur == NULL)
+ goto no_delegation;
+@@ -1556,18 +1642,16 @@ static int update_open_stateid(struct nf
+ goto no_delegation_unlock;
+
+ nfs_mark_delegation_referenced(deleg_cur);
+- __update_open_stateid(state, open_stateid, &deleg_cur->stateid,
+- fmode, &freeme);
++ nfs_state_set_delegation(state, &deleg_cur->stateid, fmode);
+ ret = 1;
+ no_delegation_unlock:
+ spin_unlock(&deleg_cur->lock);
+ no_delegation:
++ if (ret)
++ update_open_stateflags(state, fmode);
++ spin_unlock(&state->owner->so_lock);
+ rcu_read_unlock();
+
+- if (!ret && open_stateid != NULL) {
+- __update_open_stateid(state, open_stateid, NULL, fmode, &freeme);
+- ret = 1;
+- }
+ if (test_bit(NFS_STATE_RECLAIM_NOGRACE, &state->flags))
+ nfs4_schedule_state_manager(clp);
+ if (freeme.type != 0)
+--- a/fs/nfs/nfs4state.c
++++ b/fs/nfs/nfs4state.c
+@@ -639,6 +639,7 @@ nfs4_alloc_open_state(void)
+ INIT_LIST_HEAD(&state->lock_states);
+ spin_lock_init(&state->state_lock);
+ seqlock_init(&state->seqlock);
++ init_waitqueue_head(&state->waitq);
+ return state;
+ }
+
diff --git a/patches.suse/NFSv4-Fix-a-potential-sleep-while-atomic-in-nfs4_do_.patch b/patches.suse/NFSv4-Fix-a-potential-sleep-while-atomic-in-nfs4_do_.patch
new file mode 100644
index 0000000000..44be362616
--- /dev/null
+++ b/patches.suse/NFSv4-Fix-a-potential-sleep-while-atomic-in-nfs4_do_.patch
@@ -0,0 +1,135 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Sat, 3 Aug 2019 10:11:27 -0400
+Subject: [PATCH] NFSv4: Fix a potential sleep while atomic in
+ nfs4_do_reclaim()
+Git-commit: c77e22834ae9a11891cb613bd9a551be1b94f2bc
+Patch-mainline: v5.3
+References: git-fixes
+
+John Hubbard reports seeing the following stack trace:
+
+nfs4_do_reclaim
+ rcu_read_lock /* we are now in_atomic() and must not sleep */
+ nfs4_purge_state_owners
+ nfs4_free_state_owner
+ nfs4_destroy_seqid_counter
+ rpc_destroy_wait_queue
+ cancel_delayed_work_sync
+ __cancel_work_timer
+ __flush_work
+ start_flush_work
+ might_sleep:
+ (kernel/workqueue.c:2975: BUG)
+
+The solution is to separate out the freeing of the state owners
+from nfs4_purge_state_owners(), and perform that outside the atomic
+context.
+
+Reported-by: John Hubbard <jhubbard@nvidia.com>
+Fixes: 0aaaf5c424c7f ("NFS: Cache state owners after files are closed")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/nfs4_fs.h | 3 ++-
+ fs/nfs/nfs4client.c | 5 ++++-
+ fs/nfs/nfs4state.c | 27 ++++++++++++++++++++++-----
+ 3 files changed, 28 insertions(+), 7 deletions(-)
+
+--- a/fs/nfs/nfs4_fs.h
++++ b/fs/nfs/nfs4_fs.h
+@@ -435,7 +435,8 @@ static inline void nfs4_schedule_session
+
+ extern struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *, gfp_t);
+ extern void nfs4_put_state_owner(struct nfs4_state_owner *);
+-extern void nfs4_purge_state_owners(struct nfs_server *);
++extern void nfs4_purge_state_owners(struct nfs_server *, struct list_head *);
++extern void nfs4_free_state_owners(struct list_head *head);
+ extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *);
+ extern void nfs4_put_open_state(struct nfs4_state *);
+ extern void nfs4_close_state(struct nfs4_state *, fmode_t);
+--- a/fs/nfs/nfs4client.c
++++ b/fs/nfs/nfs4client.c
+@@ -738,9 +738,12 @@ out:
+
+ static void nfs4_destroy_server(struct nfs_server *server)
+ {
++ LIST_HEAD(freeme);
++
+ nfs_server_return_all_delegations(server);
+ unset_pnfs_layoutdriver(server);
+- nfs4_purge_state_owners(server);
++ nfs4_purge_state_owners(server, &freeme);
++ nfs4_free_state_owners(&freeme);
+ }
+
+ /*
+--- a/fs/nfs/nfs4state.c
++++ b/fs/nfs/nfs4state.c
+@@ -608,24 +608,39 @@ void nfs4_put_state_owner(struct nfs4_st
+ /**
+ * nfs4_purge_state_owners - Release all cached state owners
+ * @server: nfs_server with cached state owners to release
++ * @head: resulting list of state owners
+ *
+ * Called at umount time. Remaining state owners will be on
+ * the LRU with ref count of zero.
++ * Note that the state owners are not freed, but are added
++ * to the list @head, which can later be used as an argument
++ * to nfs4_free_state_owners.
+ */
+-void nfs4_purge_state_owners(struct nfs_server *server)
++void nfs4_purge_state_owners(struct nfs_server *server, struct list_head *head)
+ {
+ struct nfs_client *clp = server->nfs_client;
+ struct nfs4_state_owner *sp, *tmp;
+- LIST_HEAD(doomed);
+
+ spin_lock(&clp->cl_lock);
+ list_for_each_entry_safe(sp, tmp, &server->state_owners_lru, so_lru) {
+- list_move(&sp->so_lru, &doomed);
++ list_move(&sp->so_lru, head);
+ nfs4_remove_state_owner_locked(sp);
+ }
+ spin_unlock(&clp->cl_lock);
++}
++
++/**
++ * nfs4_purge_state_owners - Release all cached state owners
++ * @head: resulting list of state owners
++ *
++ * Frees a list of state owners that was generated by
++ * nfs4_purge_state_owners
++ */
++void nfs4_free_state_owners(struct list_head *head)
++{
++ struct nfs4_state_owner *sp, *tmp;
+
+- list_for_each_entry_safe(sp, tmp, &doomed, so_lru) {
++ list_for_each_entry_safe(sp, tmp, head, so_lru) {
+ list_del(&sp->so_lru);
+ nfs4_free_state_owner(sp);
+ }
+@@ -1777,12 +1792,13 @@ static int nfs4_do_reclaim(struct nfs_cl
+ struct nfs4_state_owner *sp;
+ struct nfs_server *server;
+ struct rb_node *pos;
++ LIST_HEAD(freeme);
+ int status = 0;
+
+ restart:
+ rcu_read_lock();
+ list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
+- nfs4_purge_state_owners(server);
++ nfs4_purge_state_owners(server, &freeme);
+ spin_lock(&clp->cl_lock);
+ for (pos = rb_first(&server->state_owners);
+ pos != NULL;
+@@ -1811,6 +1827,7 @@ restart:
+ spin_unlock(&clp->cl_lock);
+ }
+ rcu_read_unlock();
++ nfs4_free_state_owners(&freeme);
+ return 0;
+ }
+
diff --git a/patches.suse/NFSv4-Fix-an-Oops-in-nfs4_do_setattr.patch b/patches.suse/NFSv4-Fix-an-Oops-in-nfs4_do_setattr.patch
new file mode 100644
index 0000000000..a3b72c2013
--- /dev/null
+++ b/patches.suse/NFSv4-Fix-an-Oops-in-nfs4_do_setattr.patch
@@ -0,0 +1,32 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Sat, 3 Aug 2019 10:28:18 -0400
+Subject: [PATCH] NFSv4: Fix an Oops in nfs4_do_setattr
+Git-commit: 09a54f0ebfe263bc27c90bbd80187b9a93283887
+Patch-mainline: v5.3
+References: git-fixes
+
+If the user specifies an open mode of 3, then we don't have a NFSv4 state
+attached to the context, and so we Oops when we try to dereference it.
+
+Reported-by: Olga Kornievskaia <aglo@umich.edu>
+Fixes: 29b59f9416937 ("NFSv4: change nfs4_do_setattr to take...")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: stable@vger.kernel.org # v4.10: 991eedb1371dc: NFSv4: Only pass the...
+Cc: stable@vger.kernel.org # v4.10+
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/nfs4proc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -3027,7 +3027,7 @@ static int _nfs4_do_setattr(struct inode
+
+ if (nfs4_copy_delegation_stateid(inode, FMODE_WRITE, &arg->stateid, &delegation_cred)) {
+ /* Use that stateid */
+- } else if (ctx != NULL) {
++ } else if (ctx != NULL && ctx->state) {
+ struct nfs_lock_context *l_ctx;
+ if (!nfs4_valid_open_stateid(ctx->state))
+ return -EBADF;
diff --git a/patches.suse/NFSv4-Fix-delegation-state-recovery.patch b/patches.suse/NFSv4-Fix-delegation-state-recovery.patch
new file mode 100644
index 0000000000..c12af180a8
--- /dev/null
+++ b/patches.suse/NFSv4-Fix-delegation-state-recovery.patch
@@ -0,0 +1,110 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Fri, 19 Jul 2019 14:08:37 -0400
+Subject: [PATCH] NFSv4: Fix delegation state recovery
+Git-commit: 5eb8d18ca0e001c6055da2b7f30d8f6dca23a44f
+Patch-mainline: v5.3
+References: git-fixes
+
+Once we clear the NFS_DELEGATED_STATE flag, we're telling
+nfs_delegation_claim_opens() that we're done recovering all open state
+for that stateid, so we really need to ensure that we test for all
+open modes that are currently cached and recover them before exiting
+nfs4_open_delegation_recall().
+
+Fixes: 24311f884189d ("NFSv4: Recovery of recalled read delegations...")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: stable@vger.kernel.org # v4.3+
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/delegation.c | 2 +-
+ fs/nfs/delegation.h | 2 +-
+ fs/nfs/nfs4proc.c | 24 ++++++++++++------------
+ 3 files changed, 14 insertions(+), 14 deletions(-)
+
+--- a/fs/nfs/delegation.c
++++ b/fs/nfs/delegation.c
+@@ -152,7 +152,7 @@ again:
+ /* Block nfs4_proc_unlck */
+ mutex_lock(&sp->so_delegreturn_mutex);
+ seq = raw_seqcount_begin(&sp->so_reclaim_seqcount);
+- err = nfs4_open_delegation_recall(ctx, state, stateid, type);
++ err = nfs4_open_delegation_recall(ctx, state, stateid);
+ if (!err)
+ err = nfs_delegation_claim_locks(ctx, state, stateid);
+ if (!err && read_seqcount_retry(&sp->so_reclaim_seqcount, seq))
+--- a/fs/nfs/delegation.h
++++ b/fs/nfs/delegation.h
+@@ -59,7 +59,7 @@ void nfs_reap_expired_delegations(struct
+
+ /* NFSv4 delegation-related procedures */
+ int nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, const nfs4_stateid *stateid, int issync);
+-int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid, fmode_t type);
++int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid);
+ int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state, const nfs4_stateid *stateid);
+ bool nfs4_copy_delegation_stateid(struct inode *inode, fmode_t flags, nfs4_stateid *dst, struct rpc_cred **cred);
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -2030,12 +2030,10 @@ static int nfs4_handle_delegation_recall
+ case -NFS4ERR_BAD_HIGH_SLOT:
+ case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
+ case -NFS4ERR_DEADSESSION:
+- set_bit(NFS_DELEGATED_STATE, &state->flags);
+ nfs4_schedule_session_recovery(server->nfs_client->cl_session, err);
+ return -EAGAIN;
+ case -NFS4ERR_STALE_CLIENTID:
+ case -NFS4ERR_STALE_STATEID:
+- set_bit(NFS_DELEGATED_STATE, &state->flags);
+ /* Don't recall a delegation if it was lost */
+ nfs4_schedule_lease_recovery(server->nfs_client);
+ return -EAGAIN;
+@@ -2056,7 +2054,6 @@ static int nfs4_handle_delegation_recall
+ return -EAGAIN;
+ case -NFS4ERR_DELAY:
+ case -NFS4ERR_GRACE:
+- set_bit(NFS_DELEGATED_STATE, &state->flags);
+ ssleep(1);
+ return -EAGAIN;
+ case -ENOMEM:
+@@ -2072,8 +2069,7 @@ static int nfs4_handle_delegation_recall
+ }
+
+ int nfs4_open_delegation_recall(struct nfs_open_context *ctx,
+- struct nfs4_state *state, const nfs4_stateid *stateid,
+- fmode_t type)
++ struct nfs4_state *state, const nfs4_stateid *stateid)
+ {
+ struct nfs_server *server = NFS_SERVER(state->inode);
+ struct nfs4_opendata *opendata;
+@@ -2084,19 +2080,23 @@ int nfs4_open_delegation_recall(struct n
+ if (IS_ERR(opendata))
+ return PTR_ERR(opendata);
+ nfs4_stateid_copy(&opendata->o_arg.u.delegation, stateid);
+- nfs_state_clear_delegation(state);
+- switch (type & (FMODE_READ|FMODE_WRITE)) {
+- case FMODE_READ|FMODE_WRITE:
+- case FMODE_WRITE:
++ if (!test_bit(NFS_O_RDWR_STATE, &state->flags)) {
+ err = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE);
+ if (err)
+- break;
++ goto out;
++ }
++ if (!test_bit(NFS_O_WRONLY_STATE, &state->flags)) {
+ err = nfs4_open_recover_helper(opendata, FMODE_WRITE);
+ if (err)
+- break;
+- case FMODE_READ:
++ goto out;
++ }
++ if (!test_bit(NFS_O_RDONLY_STATE, &state->flags)) {
+ err = nfs4_open_recover_helper(opendata, FMODE_READ);
++ if (err)
++ goto out;
+ }
++ nfs_state_clear_delegation(state);
++out:
+ nfs4_opendata_put(opendata);
+ return nfs4_handle_delegation_recall_error(server, state, stateid, NULL, err);
+ }
diff --git a/patches.suse/NFSv4-Fix-lookup-revalidate-of-regular-files.patch b/patches.suse/NFSv4-Fix-lookup-revalidate-of-regular-files.patch
new file mode 100644
index 0000000000..8ff8a001e6
--- /dev/null
+++ b/patches.suse/NFSv4-Fix-lookup-revalidate-of-regular-files.patch
@@ -0,0 +1,148 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Fri, 28 Sep 2018 12:42:51 -0400
+Subject: [PATCH] NFSv4: Fix lookup revalidate of regular files
+Git-commit: c7944ebb9ce9461079659e9e6ec5baaf73724b3b
+Patch-mainline: v4.20
+References: git-fixes
+
+If we're revalidating an existing dentry in order to open a file, we need
+to ensure that we check the directory has not changed before we optimise
+away the lookup.
+
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/dir.c | 79 +++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 39 insertions(+), 40 deletions(-)
+
+--- a/fs/nfs/dir.c
++++ b/fs/nfs/dir.c
+@@ -1218,7 +1218,8 @@ out_bad:
+ }
+
+ static int
+-nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
++__nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags,
++ int (*reval)(struct inode *, struct dentry *, unsigned int))
+ {
+ struct dentry *parent;
+ struct inode *dir;
+@@ -1229,17 +1230,22 @@ nfs_lookup_revalidate(struct dentry *den
+ dir = d_inode_rcu(parent);
+ if (!dir)
+ return -ECHILD;
+- ret = nfs_do_lookup_revalidate(dir, dentry, flags);
++ ret = reval(dir, dentry, flags);
+ if (parent != READ_ONCE(dentry->d_parent))
+ return -ECHILD;
+ } else {
+ parent = dget_parent(dentry);
+- ret = nfs_do_lookup_revalidate(d_inode(parent), dentry, flags);
++ ret = reval(d_inode(parent), dentry, flags);
+ dput(parent);
+ }
+ return ret;
+ }
+
++static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
++{
++ return __nfs_lookup_revalidate(dentry, flags, nfs_do_lookup_revalidate);
++}
++
+ /*
+ * A weaker form of d_revalidate for revalidating just the d_inode(dentry)
+ * when we don't really care about the dentry name. This is called when a
+@@ -1588,62 +1594,55 @@ no_open:
+ }
+ EXPORT_SYMBOL_GPL(nfs_atomic_open);
+
+-static int nfs4_lookup_revalidate(struct dentry *dentry, unsigned int flags)
++static int
++nfs4_do_lookup_revalidate(struct inode *dir, struct dentry *dentry,
++ unsigned int flags)
+ {
+ struct inode *inode;
+- int ret = 0;
+
+ if (!(flags & LOOKUP_OPEN) || (flags & LOOKUP_DIRECTORY))
+- goto no_open;
++ goto full_reval;
+ if (d_mountpoint(dentry))
+- goto no_open;
+- if (NFS_SB(dentry->d_sb)->caps & NFS_CAP_ATOMIC_OPEN_V1)
+- goto no_open;
++ goto full_reval;
+
+ inode = d_inode(dentry);
+
+ /* We can't create new files in nfs_open_revalidate(), so we
+ * optimize away revalidation of negative dentries.
+ */
+- if (inode == NULL) {
+- struct dentry *parent;
+- struct inode *dir;
+-
+- if (flags & LOOKUP_RCU) {
+- parent = READ_ONCE(dentry->d_parent);
+- dir = d_inode_rcu(parent);
+- if (!dir)
+- return -ECHILD;
+- } else {
+- parent = dget_parent(dentry);
+- dir = d_inode(parent);
+- }
+- if (!nfs_neg_need_reval(dir, dentry, flags))
+- ret = 1;
+- else if (flags & LOOKUP_RCU)
+- ret = -ECHILD;
+- if (!(flags & LOOKUP_RCU))
+- dput(parent);
+- else if (parent != READ_ONCE(dentry->d_parent))
+- return -ECHILD;
+- goto out;
+- }
++ if (inode == NULL)
++ goto full_reval;
++
++ if (NFS_PROTO(dir)->have_delegation(inode, FMODE_READ))
++ return nfs_lookup_revalidate_delegated(dir, dentry, inode);
+
+ /* NFS only supports OPEN on regular files */
+ if (!S_ISREG(inode->i_mode))
+- goto no_open;
++ goto full_reval;
++
+ /* We cannot do exclusive creation on a positive dentry */
+- if (flags & LOOKUP_EXCL)
+- goto no_open;
++ if (flags & (LOOKUP_EXCL | LOOKUP_REVAL))
++ goto reval_dentry;
++
++ /* Check if the directory changed */
++ if (!nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU))
++ goto reval_dentry;
+
+ /* Let f_op->open() actually open (and revalidate) the file */
+- ret = 1;
++ return 1;
++reval_dentry:
++ if (flags & LOOKUP_RCU)
++ return -ECHILD;
++ return nfs_lookup_revalidate_dentry(dir, dentry, inode);;
+
+-out:
+- return ret;
++full_reval:
++ return nfs_do_lookup_revalidate(dir, dentry, flags);
++}
+
+-no_open:
+- return nfs_lookup_revalidate(dentry, flags);
++static int nfs4_lookup_revalidate(struct dentry *dentry, unsigned int flags)
++{
++ return __nfs_lookup_revalidate(dentry, flags,
++ nfs4_do_lookup_revalidate);
+ }
+
+ #endif /* CONFIG_NFSV4 */
diff --git a/patches.suse/NFSv4-Handle-the-special-Linux-file-open-access-mode.patch b/patches.suse/NFSv4-Handle-the-special-Linux-file-open-access-mode.patch
new file mode 100644
index 0000000000..96172c6d7e
--- /dev/null
+++ b/patches.suse/NFSv4-Handle-the-special-Linux-file-open-access-mode.patch
@@ -0,0 +1,47 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Thu, 27 Jun 2019 06:41:45 -0400
+Subject: [PATCH] NFSv4: Handle the special Linux file open access mode
+Git-commit: 44942b4e457beda00981f616402a1a791e8c616e
+Patch-mainline: v5.3
+References: git-fixes
+
+According to the open() manpage, Linux reserves the access mode 3
+to mean "check for read and write permission on the file and return
+a file descriptor that can't be used for reading or writing."
+
+Currently, the NFSv4 code will ask the server to open the file,
+and will use an incorrect share access mode of 0. Since it has
+an incorrect share access mode, the client later forgets to send
+a corresponding close, meaning it can leak stateids on the server.
+
+Fixes: ce4ef7c0a8a05 ("NFS: Split out NFS v4 file operations")
+Cc: stable@vger.kernel.org # 3.6+
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/inode.c | 1 +
+ fs/nfs/nfs4file.c | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/nfs/inode.c
++++ b/fs/nfs/inode.c
+@@ -1006,6 +1006,7 @@ int nfs_open(struct inode *inode, struct
+ nfs_fscache_open_file(inode, filp);
+ return 0;
+ }
++EXPORT_SYMBOL_GPL(nfs_open);
+
+ /*
+ * This function is called whenever some part of NFS notices that
+--- a/fs/nfs/nfs4file.c
++++ b/fs/nfs/nfs4file.c
+@@ -49,7 +49,7 @@ nfs4_file_open(struct inode *inode, stru
+ return err;
+
+ if ((openflags & O_ACCMODE) == 3)
+- openflags--;
++ return nfs_open(inode, filp);
+
+ /* We can't create new files here */
+ openflags &= ~(O_CREAT|O_EXCL);
diff --git a/patches.suse/NFSv4-Only-pass-the-delegation-to-setattr-if-we-re-s.patch b/patches.suse/NFSv4-Only-pass-the-delegation-to-setattr-if-we-re-s.patch
new file mode 100644
index 0000000000..b3297c408e
--- /dev/null
+++ b/patches.suse/NFSv4-Only-pass-the-delegation-to-setattr-if-we-re-s.patch
@@ -0,0 +1,57 @@
+From: Trond Myklebust <trond.myklebust@primarydata.com>
+Date: Mon, 9 Apr 2018 11:15:30 -0400
+Subject: [PATCH] NFSv4: Only pass the delegation to setattr if we're sending a
+ truncate
+Git-commit: 991eedb1371dc09b0f9848f59c8898fe63d198c0
+Patch-mainline: v4.18
+References: git-fixes
+
+Even then it isn't really necessary. The reason why we may not want to
+pass in a stateid in other cases is that we cannot use the delegation
+credential.
+
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/nfs4proc.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -3001,7 +3001,6 @@ static int _nfs4_do_setattr(struct inode
+ };
+ struct rpc_cred *delegation_cred = NULL;
+ unsigned long timestamp = jiffies;
+- fmode_t fmode;
+ bool truncate;
+ int status;
+
+@@ -3009,11 +3008,12 @@ static int _nfs4_do_setattr(struct inode
+
+ /* Servers should only apply open mode checks for file size changes */
+ truncate = (arg->iap->ia_valid & ATTR_SIZE) ? true : false;
+- fmode = truncate ? FMODE_WRITE : FMODE_READ;
++ if (!truncate)
++ goto zero_stateid;
+
+- if (nfs4_copy_delegation_stateid(inode, fmode, &arg->stateid, &delegation_cred)) {
++ if (nfs4_copy_delegation_stateid(inode, FMODE_WRITE, &arg->stateid, &delegation_cred)) {
+ /* Use that stateid */
+- } else if (truncate && ctx != NULL) {
++ } else if (ctx != NULL) {
+ struct nfs_lock_context *l_ctx;
+ if (!nfs4_valid_open_stateid(ctx->state))
+ return -EBADF;
+@@ -3025,8 +3025,10 @@ static int _nfs4_do_setattr(struct inode
+ nfs_put_lock_context(l_ctx);
+ if (status == -EIO)
+ return -EBADF;
+- } else
++ } else {
++zero_stateid:
+ nfs4_stateid_copy(&arg->stateid, &zero_stateid);
++ }
+ if (delegation_cred)
+ msg.rpc_cred = delegation_cred;
+
diff --git a/patches.suse/NFSv4-pnfs-Fix-a-page-lock-leak-in-nfs_pageio_resend.patch b/patches.suse/NFSv4-pnfs-Fix-a-page-lock-leak-in-nfs_pageio_resend.patch
new file mode 100644
index 0000000000..4a38c85f6c
--- /dev/null
+++ b/patches.suse/NFSv4-pnfs-Fix-a-page-lock-leak-in-nfs_pageio_resend.patch
@@ -0,0 +1,52 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Mon, 12 Aug 2019 15:19:54 -0400
+Subject: [PATCH] NFSv4/pnfs: Fix a page lock leak in nfs_pageio_resend()
+Git-commit: f4340e9314dbfadc48758945f85fc3b16612d06f
+Patch-mainline: v5.3
+References: git-fixes
+
+If the attempt to resend the pages fails, we need to ensure that we
+clean up those pages that were not transmitted.
+
+Fixes: d600ad1f2bdb ("NFS41: pop some layoutget errors to application")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: stable@vger.kernel.org # v4.5+
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/pagelist.c | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+--- a/fs/nfs/pagelist.c
++++ b/fs/nfs/pagelist.c
+@@ -1252,21 +1252,23 @@ static void nfs_pageio_complete_mirror(s
+ int nfs_pageio_resend(struct nfs_pageio_descriptor *desc,
+ struct nfs_pgio_header *hdr)
+ {
+- LIST_HEAD(failed);
++ LIST_HEAD(pages);
+
+ desc->pg_io_completion = hdr->io_completion;
+ desc->pg_dreq = hdr->dreq;
+- while (!list_empty(&hdr->pages)) {
+- struct nfs_page *req = nfs_list_entry(hdr->pages.next);
++ list_splice_init(&hdr->pages, &pages);
++ while (!list_empty(&pages)) {
++ struct nfs_page *req = nfs_list_entry(pages.next);
+
+ nfs_list_remove_request(req);
+ if (!nfs_pageio_add_request(desc, req))
+- nfs_list_add_request(req, &failed);
++ break;
+ }
+ nfs_pageio_complete(desc);
+- if (!list_empty(&failed)) {
+- list_move(&failed, &hdr->pages);
+- return desc->pg_error < 0 ? desc->pg_error : -EIO;
++ if (!list_empty(&pages)) {
++ int err = desc->pg_error < 0 ? desc->pg_error : -EIO;
++ hdr->completion_ops->error_cleanup(&pages);
++ return err;
+ }
+ return 0;
+ }
diff --git a/patches.suse/NFSv4.1-Again-fix-a-race-where-CB_NOTIFY_LOCK-fails-.patch b/patches.suse/NFSv4.1-Again-fix-a-race-where-CB_NOTIFY_LOCK-fails-.patch
new file mode 100644
index 0000000000..3fab166d42
--- /dev/null
+++ b/patches.suse/NFSv4.1-Again-fix-a-race-where-CB_NOTIFY_LOCK-fails-.patch
@@ -0,0 +1,89 @@
+From: Yihao Wu <wuyihao@linux.alibaba.com>
+Date: Wed, 22 May 2019 01:57:10 +0800
+Subject: [PATCH] NFSv4.1: Again fix a race where CB_NOTIFY_LOCK fails to wake
+ a waiter
+Git-commit: 52b042ab9948cc367b61f9ca9c18603aa7813c3a
+Patch-mainline: v5.2
+References: git-fixes
+
+Commit b7dbcc0e433f "NFSv4.1: Fix a race where CB_NOTIFY_LOCK fails to wake a waiter"
+found this bug. However it didn't fix it.
+
+This commit replaces schedule_timeout() with wait_woken() and
+default_wake_function() with woken_wake_function() in function
+nfs4_retry_setlk() and nfs4_wake_lock_waiter(). wait_woken() uses
+memory barriers in its implementation to avoid potential race condition
+when putting a process into sleeping state and then waking it up.
+
+Fixes: a1d617d8f134 ("nfs: allow blocking locks to be awoken by lock callbacks")
+Cc: stable@vger.kernel.org #4.9+
+Signed-off-by: Yihao Wu <wuyihao@linux.alibaba.com>
+Reviewed-by: Jeff Layton <jlayton@kernel.org>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Acked-by: NeilBrown <neilb@suse.com>
+---
+ fs/nfs/nfs4proc.c | 23 +++++++----------------
+ 1 file changed, 7 insertions(+), 16 deletions(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -6534,7 +6534,6 @@ struct nfs4_lock_waiter {
+ struct task_struct *task;
+ struct inode *inode;
+ struct nfs_lowner *owner;
+- bool notified;
+ };
+
+ static int
+@@ -6556,11 +6555,11 @@ nfs4_wake_lock_waiter(wait_queue_entry_t
+ if (nfs_compare_fh(NFS_FH(waiter->inode), &cbnl->cbnl_fh))
+ return 0;
+
+- waiter->notified = true;
+-
+ /* override "private" so we can use default_wake_function */
+ wait->private = waiter->task;
+- ret = autoremove_wake_function(wait, mode, flags, key);
++ ret = woken_wake_function(wait, mode, flags, key);
++ if (ret)
++ list_del_init(&wait->entry);
+ wait->private = waiter;
+ return ret;
+ }
+@@ -6569,7 +6568,6 @@ static int
+ nfs4_retry_setlk(struct nfs4_state *state, int cmd, struct file_lock *request)
+ {
+ int status = -ERESTARTSYS;
+- unsigned long flags;
+ struct nfs4_lock_state *lsp = request->fl_u.nfs4_fl.owner;
+ struct nfs_server *server = NFS_SERVER(state->inode);
+ struct nfs_client *clp = server->nfs_client;
+@@ -6579,8 +6577,7 @@ nfs4_retry_setlk(struct nfs4_state *stat
+ .s_dev = server->s_dev };
+ struct nfs4_lock_waiter waiter = { .task = current,
+ .inode = state->inode,
+- .owner = &owner,
+- .notified = false };
++ .owner = &owner};
+ wait_queue_entry_t wait;
+
+ /* Don't bother with waitqueue if we don't expect a callback */
+@@ -6598,15 +6595,9 @@ nfs4_retry_setlk(struct nfs4_state *stat
+ break;
+
+ status = -ERESTARTSYS;
+- spin_lock_irqsave(&q->lock, flags);
+- if (waiter.notified) {
+- spin_unlock_irqrestore(&q->lock, flags);
+- continue;
+- }
+- set_current_state(TASK_INTERRUPTIBLE);
+- spin_unlock_irqrestore(&q->lock, flags);
+-
+- freezable_schedule_timeout(NFS4_LOCK_MAXTIMEOUT);
++ freezer_do_not_count();
++ wait_woken(&wait, TASK_INTERRUPTIBLE, NFS4_LOCK_MAXTIMEOUT);
++ freezer_count();
+ }
+
+ finish_wait(q, &wait);
diff --git a/patches.suse/NFSv4.1-Fix-open-stateid-recovery.patch b/patches.suse/NFSv4.1-Fix-open-stateid-recovery.patch
new file mode 100644
index 0000000000..1d1ba42ce9
--- /dev/null
+++ b/patches.suse/NFSv4.1-Fix-open-stateid-recovery.patch
@@ -0,0 +1,168 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Mon, 22 Jul 2019 18:32:59 +0100
+Subject: [PATCH] NFSv4.1: Fix open stateid recovery
+Git-commit: 27a30cf64a5cbe2105e4ff9613246b32d584766a
+Patch-mainline: v5.3
+References: git-fixes
+
+The logic for checking in nfs41_check_open_stateid() whether the state
+is supported by a delegation is inverted. In addition, it makes more
+sense to perform that check before we check for expired locks.
+
+Fixes: 8a64c4ef106d1 ("NFSv4.1: Even if the stateid is OK,...")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/nfs4proc.c | 65 +++++++++++++++++++++++++++++++-----------------------
+ 1 file changed, 38 insertions(+), 27 deletions(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -1566,6 +1566,14 @@ static void nfs_set_open_stateid_locked(
+ nfs_state_log_update_open_stateid(state);
+ }
+
++static void nfs_state_clear_open_state_flags(struct nfs4_state *state)
++{
++ clear_bit(NFS_O_RDWR_STATE, &state->flags);
++ clear_bit(NFS_O_WRONLY_STATE, &state->flags);
++ clear_bit(NFS_O_RDONLY_STATE, &state->flags);
++ clear_bit(NFS_OPEN_STATE, &state->flags);
++}
++
+ static void nfs_state_set_open_stateid(struct nfs4_state *state,
+ const nfs4_stateid *open_stateid,
+ fmode_t fmode,
+@@ -1927,13 +1935,7 @@ static int nfs4_open_recover(struct nfs4
+ {
+ int ret;
+
+- /* Don't trigger recovery in nfs_test_and_clear_all_open_stateid */
+- clear_bit(NFS_O_RDWR_STATE, &state->flags);
+- clear_bit(NFS_O_WRONLY_STATE, &state->flags);
+- clear_bit(NFS_O_RDONLY_STATE, &state->flags);
+ /* memory barrier prior to reading state->n_* */
+- clear_bit(NFS_DELEGATED_STATE, &state->flags);
+- clear_bit(NFS_OPEN_STATE, &state->flags);
+ smp_rmb();
+ ret = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE);
+ if (ret != 0)
+@@ -2009,6 +2011,8 @@ static int nfs4_open_reclaim(struct nfs4
+ ctx = nfs4_state_find_open_context(state);
+ if (IS_ERR(ctx))
+ return -EAGAIN;
++ clear_bit(NFS_DELEGATED_STATE, &state->flags);
++ nfs_state_clear_open_state_flags(state);
+ ret = nfs4_do_open_reclaim(ctx, state);
+ put_nfs_open_context(ctx);
+ return ret;
+@@ -2543,6 +2547,7 @@ static int nfs40_open_expired(struct nfs
+ {
+ /* NFSv4.0 doesn't allow for delegation recovery on open expire */
+ nfs40_clear_delegation_stateid(state);
++ nfs_state_clear_open_state_flags(state);
+ return nfs4_open_expired(sp, state);
+ }
+
+@@ -2585,13 +2590,13 @@ out_free:
+ return -NFS4ERR_EXPIRED;
+ }
+
+-static void nfs41_check_delegation_stateid(struct nfs4_state *state)
++static int nfs41_check_delegation_stateid(struct nfs4_state *state)
+ {
+ struct nfs_server *server = NFS_SERVER(state->inode);
+ nfs4_stateid stateid;
+ struct nfs_delegation *delegation;
+ struct rpc_cred *cred;
+- int status;
++ int status, ret = NFS_OK;
+
+ /* Get the delegation credential for use by test/free_stateid */
+ rcu_read_lock();
+@@ -2599,20 +2604,15 @@ static void nfs41_check_delegation_state
+ if (delegation == NULL) {
+ rcu_read_unlock();
+ nfs_state_clear_delegation(state);
+- return;
++ return NFS_OK;
+ }
+
+ nfs4_stateid_copy(&stateid, &delegation->stateid);
+- if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) {
+- rcu_read_unlock();
+- nfs_state_clear_delegation(state);
+- return;
+- }
+
+ if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED,
+ &delegation->flags)) {
+ rcu_read_unlock();
+- return;
++ return NFS_OK;
+ }
+
+ cred = get_rpccred(delegation->cred);
+@@ -2621,8 +2621,24 @@ static void nfs41_check_delegation_state
+ trace_nfs4_test_delegation_stateid(state, NULL, status);
+ if (status == -NFS4ERR_EXPIRED || status == -NFS4ERR_BAD_STATEID)
+ nfs_finish_clear_delegation_stateid(state, &stateid);
++ else
++ ret = status;
+
+ put_rpccred(cred);
++ return ret;
++}
++
++static void nfs41_delegation_recover_stateid(struct nfs4_state *state)
++{
++ nfs4_stateid tmp;
++
++ if (test_bit(NFS_DELEGATED_STATE, &state->flags) &&
++ nfs4_copy_delegation_stateid(state->inode, state->state,
++ &tmp, NULL) &&
++ nfs4_stateid_match_other(&state->stateid, &tmp))
++ nfs_state_set_delegation(state, &tmp, state->state);
++ else
++ nfs_state_clear_delegation(state);
+ }
+
+ /**
+@@ -2692,21 +2708,12 @@ static int nfs41_check_open_stateid(stru
+ struct rpc_cred *cred = state->owner->so_cred;
+ int status;
+
+- if (test_bit(NFS_OPEN_STATE, &state->flags) == 0) {
+- if (test_bit(NFS_DELEGATED_STATE, &state->flags) == 0) {
+- if (nfs4_have_delegation(state->inode, state->state))
+- return NFS_OK;
+- return -NFS4ERR_OPENMODE;
+- }
++ if (test_bit(NFS_OPEN_STATE, &state->flags) == 0)
+ return -NFS4ERR_BAD_STATEID;
+- }
+ status = nfs41_test_and_free_expired_stateid(server, stateid, cred);
+ trace_nfs4_test_open_stateid(state, NULL, status);
+ if (status == -NFS4ERR_EXPIRED || status == -NFS4ERR_BAD_STATEID) {
+- clear_bit(NFS_O_RDONLY_STATE, &state->flags);
+- clear_bit(NFS_O_WRONLY_STATE, &state->flags);
+- clear_bit(NFS_O_RDWR_STATE, &state->flags);
+- clear_bit(NFS_OPEN_STATE, &state->flags);
++ nfs_state_clear_open_state_flags(state);
+ stateid->type = NFS4_INVALID_STATEID_TYPE;
+ }
+ if (status != NFS_OK)
+@@ -2720,7 +2727,11 @@ static int nfs41_open_expired(struct nfs
+ {
+ int status;
+
+- nfs41_check_delegation_stateid(state);
++ status = nfs41_check_delegation_stateid(state);
++ if (status != NFS_OK)
++ return status;
++ nfs41_delegation_recover_stateid(state);
++
+ status = nfs41_check_expired_locks(state);
+ if (status != NFS_OK)
+ return status;
diff --git a/patches.suse/NFSv4.1-Only-reap-expired-delegations.patch b/patches.suse/NFSv4.1-Only-reap-expired-delegations.patch
new file mode 100644
index 0000000000..fab73c27e3
--- /dev/null
+++ b/patches.suse/NFSv4.1-Only-reap-expired-delegations.patch
@@ -0,0 +1,64 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Fri, 26 Jul 2019 14:40:53 +0100
+Subject: [PATCH] NFSv4.1: Only reap expired delegations
+Git-commit: ad11408970df79d5f481aa9964e91f183133424c
+Patch-mainline: v5.3
+References: git-fixes
+
+Fix nfs_reap_expired_delegations() to ensure that we only reap delegations
+that are actually expired, rather than triggering on random errors.
+
+Fixes: 45870d6909d5a ("NFSv4.1: Test delegation stateids when server...")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/delegation.c | 23 +++++++++++++++++------
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+--- a/fs/nfs/delegation.c
++++ b/fs/nfs/delegation.c
+@@ -991,6 +991,22 @@ void nfs_mark_test_expired_all_delegatio
+ rcu_read_unlock();
+ }
+
++static void
++nfs_delegation_test_free_expired(struct inode *inode,
++ nfs4_stateid *stateid,
++ struct rpc_cred *cred)
++{
++ struct nfs_server *server = NFS_SERVER(inode);
++ const struct nfs4_minor_version_ops *ops = server->nfs_client->cl_mvops;
++ int status;
++
++ if (!cred)
++ return;
++ status = ops->test_and_free_expired(server, stateid, cred);
++ if (status == -NFS4ERR_EXPIRED || status == -NFS4ERR_BAD_STATEID)
++ nfs_remove_bad_delegation(inode, stateid);
++}
++
+ /**
+ * nfs_reap_expired_delegations - reap expired delegations
+ * @clp: nfs_client to process
+@@ -1002,7 +1018,6 @@ void nfs_mark_test_expired_all_delegatio
+ */
+ void nfs_reap_expired_delegations(struct nfs_client *clp)
+ {
+- const struct nfs4_minor_version_ops *ops = clp->cl_mvops;
+ struct nfs_delegation *delegation;
+ struct nfs_server *server;
+ struct inode *inode;
+@@ -1033,11 +1048,7 @@ restart:
+ nfs4_stateid_copy(&stateid, &delegation->stateid);
+ clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags);
+ rcu_read_unlock();
+- if (cred != NULL &&
+- ops->test_and_free_expired(server, &stateid, cred) < 0) {
+- nfs_revoke_delegation(inode, &stateid);
+- nfs_inode_find_state_and_recover(inode, &stateid);
+- }
++ nfs_delegation_test_free_expired(inode, &stateid, cred);
+ put_rpccred(cred);
+ if (nfs4_server_rebooted(clp)) {
+ nfs_inode_mark_test_expired_delegation(server,inode);
diff --git a/patches.suse/PNFS-fallback-to-MDS-if-no-deviceid-found.patch b/patches.suse/PNFS-fallback-to-MDS-if-no-deviceid-found.patch
new file mode 100644
index 0000000000..4876e0d10a
--- /dev/null
+++ b/patches.suse/PNFS-fallback-to-MDS-if-no-deviceid-found.patch
@@ -0,0 +1,32 @@
+From: Olga Kornievskaia <kolga@netapp.com>
+Date: Tue, 7 May 2019 13:41:49 -0400
+Subject: [PATCH] PNFS fallback to MDS if no deviceid found
+Git-commit: b1029c9bc078a6f1515f55dd993b507dcc7e3440
+Patch-mainline: v5.2
+References: git-fixes
+
+If we fail to find a good deviceid while trying to pnfs instead of
+propogating an error back fallback to doing IO to the MDS. Currently,
+code with fals the IO with EINVAL.
+
+Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
+Fixes: 8d40b0f14846f ("NFS filelayout:call GETDEVICEINFO after pnfs_layout_process completes"
+Cc: stable@vger.kernel.org # v4.11+
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/filelayout/filelayout.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/nfs/filelayout/filelayout.c
++++ b/fs/nfs/filelayout/filelayout.c
+@@ -932,7 +932,7 @@ fl_pnfs_update_layout(struct inode *ino,
+ status = filelayout_check_deviceid(lo, fl, gfp_flags);
+ if (status) {
+ pnfs_put_lseg(lseg);
+- lseg = ERR_PTR(status);
++ lseg = NULL;
+ }
+ out:
+ return lseg;
diff --git a/patches.suse/SUNRPC-Handle-connection-breakages-correctly-in-call.patch b/patches.suse/SUNRPC-Handle-connection-breakages-correctly-in-call.patch
new file mode 100644
index 0000000000..35bf86b3df
--- /dev/null
+++ b/patches.suse/SUNRPC-Handle-connection-breakages-correctly-in-call.patch
@@ -0,0 +1,29 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Fri, 16 Aug 2019 08:58:48 -0400
+Subject: [PATCH] SUNRPC: Handle connection breakages correctly in
+ call_status()
+Git-commit: c82e5472c9980e0e483f4b689044150eefaca408
+Patch-mainline: v5.3
+References: git-fixes
+
+If the connection breaks while we're waiting for a reply from the
+server, then we want to immediately try to reconnect.
+
+Fixes: ec6017d90359 ("SUNRPC fix regression in umount of a secure mount")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ net/sunrpc/clnt.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/net/sunrpc/clnt.c
++++ b/net/sunrpc/clnt.c
+@@ -2177,6 +2177,7 @@ call_status(struct rpc_task *task)
+ case -ECONNABORTED:
+ case -ENOTCONN:
+ rpc_force_rebind(clnt);
++ break;
+ case -EADDRINUSE:
+ rpc_delay(task, 3*HZ);
+ case -EPIPE:
diff --git a/patches.suse/SUNRPC-fix-regression-in-umount-of-a-secure-mount.patch b/patches.suse/SUNRPC-fix-regression-in-umount-of-a-secure-mount.patch
new file mode 100644
index 0000000000..41599d0512
--- /dev/null
+++ b/patches.suse/SUNRPC-fix-regression-in-umount-of-a-secure-mount.patch
@@ -0,0 +1,36 @@
+From: Olga Kornievskaia <kolga@netapp.com>
+Date: Wed, 29 May 2019 10:46:00 -0400
+Subject: [PATCH] SUNRPC fix regression in umount of a secure mount
+Git-commit: ec6017d9035986a36de064f48a63245930bfad6f
+Patch-mainline: v5.2
+References: git-fixes
+
+If call_status returns ENOTCONN, we need to re-establish the connection
+state after. Otherwise the client goes into an infinite loop of call_encode,
+call_transmit, call_status (ENOTCONN), call_encode.
+
+Fixes: c8485e4d63 ("SUNRPC: Handle ECONNREFUSED correctly in xprt_transmit()")
+Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
+Cc: stable@vger.kernel.org # v2.6.29+
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ net/sunrpc/clnt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/sunrpc/clnt.c
++++ b/net/sunrpc/clnt.c
+@@ -2175,11 +2175,11 @@ call_status(struct rpc_task *task)
+ case -ECONNREFUSED:
+ case -ECONNRESET:
+ case -ECONNABORTED:
++ case -ENOTCONN:
+ rpc_force_rebind(clnt);
+ case -EADDRINUSE:
+ rpc_delay(task, 3*HZ);
+ case -EPIPE:
+- case -ENOTCONN:
+ task->tk_action = call_bind;
+ break;
+ case -ENOBUFS:
diff --git a/patches.suse/SUNRPC-nfs-Fix-return-value-for-nfs4_callback_compou.patch b/patches.suse/SUNRPC-nfs-Fix-return-value-for-nfs4_callback_compou.patch
new file mode 100644
index 0000000000..c33bb8e4f0
--- /dev/null
+++ b/patches.suse/SUNRPC-nfs-Fix-return-value-for-nfs4_callback_compou.patch
@@ -0,0 +1,103 @@
+From: Trond Myklebust <trondmy@gmail.com>
+Date: Tue, 9 Apr 2019 11:46:14 -0400
+Subject: [PATCH] SUNRPC/nfs: Fix return value for nfs4_callback_compound()
+Git-commit: 83dd59a0b9afc3b1a2642fb5c9b0585b1c08768f
+Patch-mainline: v5.2
+References: git-fixes
+
+RPC server procedures are normally expected to return a __be32 encoded
+status value of type 'enum rpc_accept_stat', however at least one function
+wants to return an authentication status of type 'enum rpc_auth_stat'
+in the case where authentication fails.
+This patch adds functionality to allow this.
+
+Fixes: a4e187d83d88 ("NFS: Don't drop CB requests with invalid principals")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/callback_xdr.c | 2 +-
+ include/linux/sunrpc/svc.h | 2 ++
+ net/sunrpc/svc.c | 27 ++++++++++++++++++++++-----
+ 3 files changed, 25 insertions(+), 6 deletions(-)
+
+--- a/fs/nfs/callback_xdr.c
++++ b/fs/nfs/callback_xdr.c
+@@ -931,7 +931,7 @@ static __be32 nfs4_callback_compound(str
+
+ out_invalidcred:
+ pr_warn_ratelimited("NFS: NFSv4 callback contains invalid cred\n");
+- return rpc_autherr_badcred;
++ return svc_return_autherr(rqstp, rpc_autherr_badcred);
+ }
+
+ /*
+--- a/include/linux/sunrpc/svc.h
++++ b/include/linux/sunrpc/svc.h
+@@ -269,6 +269,7 @@ struct svc_rqst {
+ #define RQ_VICTIM (5) /* about to be shut down */
+ #define RQ_BUSY (6) /* request is busy */
+ #define RQ_DATA (7) /* request has data */
++#define RQ_AUTHERR (8) /* Request status is auth error */
+ unsigned long rq_flags; /* flags field */
+
+ void * rq_argp; /* decoded arguments */
+@@ -493,6 +494,7 @@ void svc_wake_up(struct svc_serv *);
+ void svc_reserve(struct svc_rqst *rqstp, int space);
+ struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu);
+ char * svc_print_addr(struct svc_rqst *, char *, size_t);
++__be32 svc_return_autherr(struct svc_rqst *rqstp, __be32 auth_err);
+
+ #define RPC_MAX_ADDRBUFLEN (63U)
+
+--- a/net/sunrpc/svc.c
++++ b/net/sunrpc/svc.c
+@@ -1144,6 +1144,22 @@ void svc_printk(struct svc_rqst *rqstp,
+ static __printf(2,3) void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) {}
+ #endif
+
++__be32
++svc_return_autherr(struct svc_rqst *rqstp, __be32 auth_err)
++{
++ set_bit(RQ_AUTHERR, &rqstp->rq_flags);
++ return auth_err;
++}
++EXPORT_SYMBOL_GPL(svc_return_autherr);
++
++static __be32
++svc_get_autherr(struct svc_rqst *rqstp, __be32 *statp)
++{
++ if (test_and_clear_bit(RQ_AUTHERR, &rqstp->rq_flags))
++ return *statp;
++ return rpc_auth_ok;
++}
++
+ /*
+ * Common routine for processing the RPC request.
+ */
+@@ -1295,11 +1311,9 @@ svc_process_common(struct svc_rqst *rqst
+ procp->pc_release(rqstp, NULL, rqstp->rq_resp);
+ goto dropit;
+ }
+- if (*statp == rpc_autherr_badcred) {
+- if (procp->pc_release)
+- procp->pc_release(rqstp, NULL, rqstp->rq_resp);
+- goto err_bad_auth;
+- }
++ auth_stat = svc_get_autherr(rqstp, statp);
++ if (auth_stat != rpc_auth_ok)
++ goto err_release_bad_auth;
+ if (*statp == rpc_success &&
+ (xdr = procp->pc_encode) &&
+ !xdr(rqstp, resv->iov_base+resv->iov_len, rqstp->rq_resp)) {
+@@ -1357,6 +1371,9 @@ err_bad_rpc:
+ svc_putnl(resv, 2);
+ goto sendit;
+
++err_release_bad_auth:
++ if (procp->pc_release)
++ procp->pc_release(rqstp, NULL, rqstp->rq_resp);
+ err_bad_auth:
+ dprintk("svc: authentication failed (%d)\n", ntohl(auth_stat));
+ serv->sv_stats->rpcbadauth++;
diff --git a/patches.suse/nfsd-Don-t-release-the-callback-slot-unless-it-was-a.patch b/patches.suse/nfsd-Don-t-release-the-callback-slot-unless-it-was-a.patch
new file mode 100644
index 0000000000..54a432c96a
--- /dev/null
+++ b/patches.suse/nfsd-Don-t-release-the-callback-slot-unless-it-was-a.patch
@@ -0,0 +1,81 @@
+From: Trond Myklebust <trondmy@gmail.com>
+Date: Fri, 5 Apr 2019 08:54:37 -0700
+Subject: [PATCH] nfsd: Don't release the callback slot unless it was actually
+ held
+Git-commit: e6abc8caa6deb14be2a206253f7e1c5e37e9515b
+Patch-mainline: v5.1
+References: git-fixes
+
+If there are multiple callbacks queued, waiting for the callback
+slot when the callback gets shut down, then they all currently
+end up acting as if they hold the slot, and call
+nfsd4_cb_sequence_done() resulting in interesting side-effects.
+
+In addition, the 'retry_nowait' path in nfsd4_cb_sequence_done()
+causes a loop back to nfsd4_cb_prepare() without first freeing the
+slot, which causes a deadlock when nfsd41_cb_get_slot() gets called
+a second time.
+
+This patch therefore adds a boolean to track whether or not the
+callback did pick up the slot, so that it can do the right thing
+in these 2 cases.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfsd/nfs4callback.c | 8 +++++++-
+ fs/nfsd/state.h | 1 +
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+--- a/fs/nfsd/nfs4callback.c
++++ b/fs/nfsd/nfs4callback.c
+@@ -931,8 +931,9 @@ static void nfsd4_cb_prepare(struct rpc_
+ cb->cb_seq_status = 1;
+ cb->cb_status = 0;
+ if (minorversion) {
+- if (!nfsd41_cb_get_slot(clp, task))
++ if (!cb->cb_holds_slot && !nfsd41_cb_get_slot(clp, task))
+ return;
++ cb->cb_holds_slot = true;
+ }
+ rpc_call_start(task);
+ }
+@@ -959,6 +960,9 @@ static bool nfsd4_cb_sequence_done(struc
+ return true;
+ }
+
++ if (!cb->cb_holds_slot)
++ goto need_restart;
++
+ switch (cb->cb_seq_status) {
+ case 0:
+ /*
+@@ -996,6 +1000,7 @@ static bool nfsd4_cb_sequence_done(struc
+ cb->cb_seq_status);
+ }
+
++ cb->cb_holds_slot = false;
+ clear_bit(0, &clp->cl_cb_slot_busy);
+ rpc_wake_up_next(&clp->cl_cb_waitq);
+ dprintk("%s: freed slot, new seqid=%d\n", __func__,
+@@ -1203,6 +1208,7 @@ void nfsd4_init_cb(struct nfsd4_callback
+ cb->cb_seq_status = 1;
+ cb->cb_status = 0;
+ cb->cb_need_restart = false;
++ cb->cb_holds_slot = false;
+ }
+
+ void nfsd4_run_cb(struct nfsd4_callback *cb)
+--- a/fs/nfsd/state.h
++++ b/fs/nfsd/state.h
+@@ -69,6 +69,7 @@ struct nfsd4_callback {
+ int cb_seq_status;
+ int cb_status;
+ bool cb_need_restart;
++ bool cb_holds_slot;
+ };
+
+ struct nfsd4_callback_ops {
diff --git a/patches.suse/pNFS-flexfiles-Turn-off-soft-RPC-calls.patch b/patches.suse/pNFS-flexfiles-Turn-off-soft-RPC-calls.patch
new file mode 100644
index 0000000000..0b1eecc87e
--- /dev/null
+++ b/patches.suse/pNFS-flexfiles-Turn-off-soft-RPC-calls.patch
@@ -0,0 +1,42 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Thu, 15 Aug 2019 20:18:48 -0400
+Subject: [PATCH] pNFS/flexfiles: Turn off soft RPC calls
+Git-commit: bf2bf9b80e0cd3568ddc85a241abe0dd8b46ebdc
+Patch-mainline: v5.3
+References: git-fixes
+
+The pNFS/flexfiles I/O requests are sent with the SOFTCONN flag set, so
+they automatically time out if the connection breaks. It should
+therefore not be necessary to have the soft flag set in addition.
+
+Fixes: 5f01d9539496 ("nfs41: create NFSv3 DS connection if specified")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/pnfs_nfs.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+--- a/fs/nfs/pnfs_nfs.c
++++ b/fs/nfs/pnfs_nfs.c
+@@ -650,11 +650,15 @@ static int _nfs4_pnfs_v3_ds_connect(stru
+ /* Add this address as an alias */
+ rpc_clnt_add_xprt(clp->cl_rpcclient, &xprt_args,
+ rpc_clnt_test_and_add_xprt, NULL);
+- } else
+- clp = get_v3_ds_connect(mds_srv,
+- (struct sockaddr *)&da->da_addr,
+- da->da_addrlen, IPPROTO_TCP,
+- timeo, retrans);
++ continue;
++ }
++ clp = get_v3_ds_connect(mds_srv,
++ (struct sockaddr *)&da->da_addr,
++ da->da_addrlen, IPPROTO_TCP,
++ timeo, retrans);
++ if (IS_ERR(clp))
++ continue;
++ clp->cl_rpcclient->cl_softrtry = 0;
+ }
+
+ if (IS_ERR(clp)) {
diff --git a/patches.suse/pnfs-flexfiles-Fix-PTR_ERR-dereferences-in-ff_layout.patch b/patches.suse/pnfs-flexfiles-Fix-PTR_ERR-dereferences-in-ff_layout.patch
new file mode 100644
index 0000000000..ae587d02b3
--- /dev/null
+++ b/patches.suse/pnfs-flexfiles-Fix-PTR_ERR-dereferences-in-ff_layout.patch
@@ -0,0 +1,31 @@
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Wed, 17 Jul 2019 13:57:44 -0400
+Subject: [PATCH] pnfs/flexfiles: Fix PTR_ERR() dereferences in
+ ff_layout_track_ds_error
+Git-commit: 8e04fdfadda75a849c649f7e50fe7d97772e1fcb
+Patch-mainline: v5.3
+References: git-fixes
+
+mirror->mirror_ds can be NULL if uninitialised, but can contain
+a PTR_ERR() if call to GETDEVICEINFO failed.
+
+Fixes: 65990d1afbd2 ("pNFS/flexfiles: Fix a deadlock on LAYOUTGET")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: stable@vger.kernel.org # 4.10+
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/nfs/flexfilelayout/flexfilelayoutdev.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
++++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+@@ -305,7 +305,7 @@ int ff_layout_track_ds_error(struct nfs4
+ if (status == 0)
+ return 0;
+
+- if (mirror->mirror_ds == NULL)
++ if (IS_ERR_OR_NULL(mirror->mirror_ds))
+ return -EINVAL;
+
+ dserr = kmalloc(sizeof(*dserr), gfp_flags);
diff --git a/series.conf b/series.conf
index 08bc480cd7..219a2ff806 100644
--- a/series.conf
+++ b/series.conf
@@ -10367,6 +10367,7 @@
patches.suse/NFSv4.1-Fix-up-replays-of-interrupted-requests.patch
patches.suse/NFS-Avoid-RCU-usage-in-tracepoints.patch
patches.suse/sunrpc-Fix-rpc_task_begin-trace-point.patch
+ patches.suse/NFSv4-Fix-OPEN-CLOSE-race.patch
patches.suse/NFS-Fix-a-typo-in-nfs_rename.patch
patches.suse/0002-nfs-Fix-ugly-referral-attributes.patch
patches.suse/NFS-Fix-typo-in-nomigration-mount-option.patch
@@ -17705,6 +17706,7 @@
patches.suse/nfsd-fix-potential-use-after-free-in-nfsd4_decode_ge.patch
patches.suse/0001-rculist-add-list_for_each_entry_from_rcu.patch
patches.suse/0003-NFS-Avoid-quadratic-search-when-freeing-delegations.patch
+ patches.suse/NFSv4-Only-pass-the-delegation-to-setattr-if-we-re-s.patch
patches.suse/0004-NFSv4-Fix-possible-1-byte-stack-overflow-in-nfs_idma.patch
patches.suse/pnfs-Don-t-release-the-sequence-slot-until-we-ve-pro.patch
patches.suse/xprtrdma-Return-ENOBUFS-when-no-pages-are-available.patch
@@ -19565,6 +19567,7 @@
patches.suse/Revert-cdc-acm-implement-put_char-and-flush_chars.patch
patches.suse/0001-xen-manage-don-t-complain-about-an-empty-value-in-co.patch
patches.suse/NFSv4.1-fix-infinite-loop-on-I-O.patch
+ patches.suse/NFS-Don-t-open-code-clearing-of-delegation-state.patch
patches.suse/fs-cifs-suppress-a-string-overflow-warning.patch
patches.suse/fs-cifs-require-sha512.patch
patches.suse/cifs-prevent-integer-overflow-in-nxt_dir_entry.patch
@@ -20353,6 +20356,8 @@
patches.suse/cifs-update-internal-module-version-number-for-cifs-ko-to-2-14.patch
patches.suse/NFSv4.1-Fix-the-r-wsize-checking.patch
patches.suse/NFS-Fix-dentry-revalidation-on-NFSv4-lookup.patch
+ patches.suse/NFS-Refactor-nfs_lookup_revalidate.patch
+ patches.suse/NFSv4-Fix-lookup-revalidate-of-regular-files.patch
patches.suse/nfs-Fix-a-missed-page-unlock-after-pg_doio.patch
patches.suse/sunrpc-safely-reallow-resvport-min-max-inversion.patch
patches.suse/xprtrdma-Reset-credit-grant-properly-after-a-disconn.patch
@@ -22459,6 +22464,7 @@
patches.suse/NFS-Fix-an-I-O-request-leakage-in-nfs_do_recoalesce.patch
patches.suse/NFS-Don-t-recoalesce-on-error-in-nfs_pageio_complete.patch
patches.suse/fs-nfs-Fix-nfs_parse_devname-to-not-modify-it-s-argu.patch
+ patches.suse/NFS-Remove-redundant-semicolon.patch
patches.suse/NFS-Fix-a-soft-lockup-in-the-delegation-recovery-cod.patch
patches.suse/NFS-pnfs-Bulk-destroy-of-layouts-needs-to-be-safe-w..patch
patches.suse/NFSv4.1-Reinitialise-sequence-results-before-retrans.patch
@@ -22835,6 +22841,7 @@
patches.suse/0001-PCI-pciehp-Ignore-Link-State-Changes-after-powering-.patch
patches.suse/clk-x86-Add-system-specific-quirk-to-mark-clocks-as-.patch
patches.suse/platform-x86-pmc_atom-Drop-__initconst-on-dmi-table.patch
+ patches.suse/NFS-Forbid-setting-AF_INET6-to-struct-sockaddr_in-si.patch
patches.suse/virtio-blk-limit-number-of-hw-queues-by-nr_cpu_ids.patch
patches.suse/blk-mq-introduce-blk_mq_complete_request_sync.patch
patches.suse/nvme-cancel-request-synchronously.patch
@@ -22911,6 +22918,7 @@
patches.suse/ALSA-core-Fix-card-races-between-register-and-discon.patch
patches.suse/ALSA-hda-realtek-add-two-more-pin-configuration-sets.patch
patches.suse/scsi-core-set-result-when-the-command-cannot-be-dispatched
+ patches.suse/nfsd-Don-t-release-the-callback-slot-unless-it-was-a.patch
patches.suse/ipv4-set-the-tcp_min_rtt_wlen-range-from-0-to-one-da.patch
patches.suse/mlxsw-spectrum-Fix-autoneg-status-in-ethtool.patch
patches.suse/stmmac-pci-Adjust-IOT2000-matching.patch
@@ -23371,7 +23379,10 @@
patches.suse/dmaengine-axi-dmac-Don-t-check-the-number-of-frames-.patch
patches.suse/dmaengine-tegra210-dma-free-dma-controller-in-remove.patch
patches.suse/RDMA-rxe-Consider-skb-reserve-space-based-on-netdev-.patch
+ patches.suse/NFS-Don-t-interrupt-file-writeout-due-to-fatal-error.patch
patches.suse/NFS-make-nfs_match_client-killable.patch
+ patches.suse/PNFS-fallback-to-MDS-if-no-deviceid-found.patch
+ patches.suse/NFS4-Fix-v4.0-client-state-corruption-when-mount.patch
patches.suse/NFS-Fix-a-double-unlock-from-nfs_match-get_client.patch
patches.suse/i2c-piix4-add-hygon-dhyana-smbus-support.patch
patches.suse/rtc-don-t-reference-bogus-function-pointer-in-kdoc.patch
@@ -23481,6 +23492,7 @@
patches.suse/x86_64-allow-breakpoints-to-emulate-call-instructions.patch
patches.suse/ftrace-x86_64-emulate-call-function-while-updating-in-breakpoint-handler.patch
patches.suse/tracing-fix-partial-reading-of-trace-event-s-id-file.patch
+ patches.suse/SUNRPC-nfs-Fix-return-value-for-nfs4_callback_compou.patch
patches.suse/0001-xenbus-drop-useless-LIST_HEAD-in-xenbus_write_watch-.patch
patches.suse/power-supply-axp288_charger-Fix-unchecked-return-val.patch
patches.suse/power-supply-max14656-fix-potential-use-before-alloc.patch
@@ -23651,6 +23663,8 @@
patches.suse/powerpc-perf-Fix-MMCRA-corruption-by-bhrb_filter.patch
patches.suse/efi-x86-Add-missing-error-handling-to-old_memmap-1-1.patch
patches.suse/x86-cpu-amd-don-t-force-the-cpb-cap-when-running-under-a-hypervisor.patch
+ patches.suse/SUNRPC-fix-regression-in-umount-of-a-secure-mount.patch
+ patches.suse/NFSv4.1-Again-fix-a-race-where-CB_NOTIFY_LOCK-fails-.patch
patches.suse/fuse-fallocate-fix-return-with-locked-inode.patch
patches.suse/s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-udev-event
patches.suse/Fix-memory-leak-in-sctp_process_init.patch
@@ -24187,7 +24201,9 @@
patches.suse/cifs-fix-crash-in-cifs_dfs_do_automount.patch
patches.suse/cifs-fix-crash-in-smb2_compound_op-smb2_set_next_command-.patch
patches.suse/smb3-smbdirect-no-longer-experimental.patch
+ patches.suse/NFSv4-Handle-the-special-Linux-file-open-access-mode.patch
patches.suse/NFS-Cleanup-if-nfs_match_client-is-interrupted.patch
+ patches.suse/pnfs-flexfiles-Fix-PTR_ERR-dereferences-in-ff_layout.patch
patches.suse/dm-zoned-fix-zone-state-management-race.patch
patches.suse/net-neigh-fix-multiple-neigh-timer-scheduling.patch
patches.suse/0015-ISDN-hfcsusb-checking-idx-of-ep-configuration.patch
@@ -24328,6 +24344,13 @@
patches.suse/SMB3-Fix-potential-memory-leak-when-processing-compound-chain.patch
patches.suse/smb3-send-CAP_DFS-capability-during-session-setup.patch
patches.suse/SMB3-Kernel-oops-mounting-a-encryptData-share-with-CONFIG_DEBUG_VIR.patch
+ patches.suse/NFSv4-Fix-delegation-state-recovery.patch
+ patches.suse/NFSv4.1-Fix-open-stateid-recovery.patch
+ patches.suse/NFSv4.1-Only-reap-expired-delegations.patch
+ patches.suse/NFSv4-Check-the-return-value-of-update_open_stateid.patch
+ patches.suse/NFSv4-Fix-a-potential-sleep-while-atomic-in-nfs4_do_.patch
+ patches.suse/NFSv4-Fix-an-Oops-in-nfs4_do_setattr.patch
+ patches.suse/NFS-Fix-regression-whereby-fscache-errors-are-appear.patch
patches.suse/crypto-ccp-Fix-oops-by-properly-managing-allocated-s.patch
patches.suse/crypto-ccp-Add-support-for-valid-authsize-values-les.patch
patches.suse/crypto-ccp-Ignore-tag-length-when-decrypting-GCM-cip.patch
@@ -24438,6 +24461,10 @@
patches.suse/r8152-Set-memory-to-all-0xFFs-on-failed-reg-reads.patch
patches.suse/ALSA-line6-Fix-memory-leak-at-line6_init_pcm-error-p.patch
patches.suse/ALSA-seq-Fix-potential-concurrent-access-to-the-dele.patch
+ patches.suse/NFSv4-pnfs-Fix-a-page-lock-leak-in-nfs_pageio_resend.patch
+ patches.suse/NFS-Ensure-O_DIRECT-reports-an-error-if-the-bytes-re.patch
+ patches.suse/pNFS-flexfiles-Turn-off-soft-RPC-calls.patch
+ patches.suse/SUNRPC-Handle-connection-breakages-correctly-in-call.patch
patches.suse/0001-drm-i915-Don-t-deballoon-unused-ggtt-drm_mm_node-in-.patch
patches.suse/mmc-sdhci-of-at91-add-quirk-for-broken-HS200.patch
patches.suse/mmc-core-Fix-init-of-SD-cards-reporting-an-invalid-V.patch
@@ -25521,6 +25548,8 @@
patches.kabi/kabi-fix-struct-ufs_reg-removal-of-unused-field
+ patches.kabi/NFSv4-Fix-OPEN-CLOSE-race.patch
+
########################################################
# You'd better have a good reason for adding a patch
# below here.