[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220926100801.499600091@linuxfoundation.org>
Date: Mon, 26 Sep 2022 12:12:55 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, David Wysochanski <dwysocha@...hat.com>,
Trond Myklebust <trond.myklebust@...merspace.com>,
Thorsten Leemhuis <regressions@...mhuis.info>
Subject: [PATCH 5.15 141/148] NFSv4: Fixes for nfs4_inode_return_delegation()
From: Trond Myklebust <trond.myklebust@...merspace.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@...hat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@...merspace.com>
Cc: Thorsten Leemhuis <regressions@...mhuis.info>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.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;
}
Powered by blists - more mailing lists