From 8bf5f3a4eb56f44f2fea9cc189a24abb537c5ad8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 26 Sep 2022 08:26:11 +0200 Subject: [PATCH] 5.15-stable patches added patches: nfsv4-fixes-for-nfs4_inode_return_delegation.patch --- ...xes-for-nfs4_inode_return_delegation.patch | 40 +++++++++++++++++++ queue-5.15/series | 1 + 2 files changed, 41 insertions(+) create mode 100644 queue-5.15/nfsv4-fixes-for-nfs4_inode_return_delegation.patch 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 index 00000000000..f366e16eb4b --- /dev/null +++ b/queue-5.15/nfsv4-fixes-for-nfs4_inode_return_delegation.patch @@ -0,0 +1,40 @@ +From 6e176d47160cec8bcaa28d9aa06926d72d54237c Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Sun, 10 Oct 2021 10:58:12 +0200 +Subject: NFSv4: Fixes for nfs4_inode_return_delegation() + +From: Trond Myklebust + +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 +Signed-off-by: Trond Myklebust +Cc: Thorsten Leemhuis +Signed-off-by: Greg Kroah-Hartman +--- + 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; + } + diff --git a/queue-5.15/series b/queue-5.15/series index ce5c76a317c..d05b298ea8f 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -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 -- 2.47.3