diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-02-07 17:48:15 +0000 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-02-07 17:48:15 +0000 |
commit | c8d80f83de47fd183a0eef2d6b1085d4fdecea37 (patch) | |
tree | 2e45c556b17625936845669bb1f4605d09635403 | |
parent | 6d280f4d760e3bcb4a8df302afebf085b65ec982 (diff) | |
parent | 5ea9a7c5fe4149f165f0e3b624fe08df02b6c301 (diff) | |
download | linux-c8d80f83de47fd183a0eef2d6b1085d4fdecea37.tar.gz linux-c8d80f83de47fd183a0eef2d6b1085d4fdecea37.tar.bz2 linux-c8d80f83de47fd183a0eef2d6b1085d4fdecea37.zip |
Merge tag 'nfsd-6.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fix from Chuck Lever:
- Address a deadlock regression in RELEASE_LOCKOWNER
* tag 'nfsd-6.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
nfsd: don't take fi_lock in nfsd_break_deleg_cb()
-rw-r--r-- | fs/nfsd/nfs4state.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 6dc6340e2852..7d6c657e0409 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4945,10 +4945,8 @@ nfsd_break_deleg_cb(struct file_lock *fl) */ fl->fl_break_time = 0; - spin_lock(&fp->fi_lock); fp->fi_had_conflict = true; nfsd_break_one_deleg(dp); - spin_unlock(&fp->fi_lock); return false; } @@ -5557,12 +5555,13 @@ nfs4_set_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp, if (status) goto out_unlock; + status = -EAGAIN; + if (fp->fi_had_conflict) + goto out_unlock; + spin_lock(&state_lock); spin_lock(&fp->fi_lock); - if (fp->fi_had_conflict) - status = -EAGAIN; - else - status = hash_delegation_locked(dp, fp); + status = hash_delegation_locked(dp, fp); spin_unlock(&fp->fi_lock); spin_unlock(&state_lock); |