]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Sep 2022 06:26:11 +0000 (08:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Sep 2022 06:26:11 +0000 (08:26 +0200)
added patches:
nfsv4-fixes-for-nfs4_inode_return_delegation.patch

queue-5.15/nfsv4-fixes-for-nfs4_inode_return_delegation.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/nfsv4-fixes-for-nfs4_inode_return_delegation.patch b/queue-5.15/nfsv4-fixes-for-nfs4_inode_return_delegation.patch
new file mode 100644 (file)
index 0000000..f366e16
--- /dev/null
@@ -0,0 +1,40 @@
+From 6e176d47160cec8bcaa28d9aa06926d72d54237c Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Sun, 10 Oct 2021 10:58:12 +0200
+Subject: NFSv4: Fixes for nfs4_inode_return_delegation()
+
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+
+commit 6e176d47160cec8bcaa28d9aa06926d72d54237c upstream.
+
+We mustn't call nfs_wb_all() on anything other than a regular file.
+Furthermore, we can exit early when we don't hold a delegation.
+
+Reported-by: David Wysochanski <dwysocha@redhat.com>
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Cc: Thorsten Leemhuis <regressions@leemhuis.info>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfs/delegation.c |   10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/fs/nfs/delegation.c
++++ b/fs/nfs/delegation.c
+@@ -755,11 +755,13 @@ int nfs4_inode_return_delegation(struct
+       struct nfs_delegation *delegation;
+       delegation = nfs_start_delegation_return(nfsi);
+-      /* Synchronous recall of any application leases */
+-      break_lease(inode, O_WRONLY | O_RDWR);
+-      nfs_wb_all(inode);
+-      if (delegation != NULL)
++      if (delegation != NULL) {
++              /* Synchronous recall of any application leases */
++              break_lease(inode, O_WRONLY | O_RDWR);
++              if (S_ISREG(inode->i_mode))
++                      nfs_wb_all(inode);
+               return nfs_end_delegation_return(inode, delegation, 1);
++      }
+       return 0;
+ }
index ce5c76a317ce77bd78a6977a7165b969a8d56b0f..d05b298ea8f395c4b8e37b88e532676ab9b551af 100644 (file)
@@ -138,3 +138,4 @@ i2c-mlxbf-incorrect-base-address-passed-during-io-wr.patch
 i2c-mlxbf-prevent-stack-overflow-in-mlxbf_i2c_smbus_.patch
 i2c-mlxbf-fix-frequency-calculation.patch
 drm-amdgpu-don-t-register-a-dirty-callback-for-non-a.patch
+nfsv4-fixes-for-nfs4_inode_return_delegation.patch