]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
nfs: don't atempt blocking locks on nfs reexports
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 20 Aug 2021 21:02:04 +0000 (17:02 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 5 Nov 2021 09:19:06 +0000 (10:19 +0100)
commit456b50456f6927965ed71b32723876659d7485d4
tree676e4b74962974aca2fbe928d2b389880eb5ab15
parent497bd38e27b308f64dc0dc96826114e6098f3e1e
nfs: don't atempt blocking locks on nfs reexports

BugLink: https://bugs.launchpad.net/bugs/1947781
[ Upstream commit f657f8eef3ff870552c9fd2839e0061046f44618 ]

NFS implements blocking locks by blocking inside its lock method.  In
the reexport case, this blocks the nfs server thread, which could lead
to deadlocks since an nfs server thread might be required to unlock the
conflicting lock.  It also causes a crash, since the nfs server thread
assumes it can free the lock when its lm_notify lock callback is called.

Ideal would be to make the nfs lock method return without blocking in
this case, but for now it works just not to attempt blocking locks.  The
difference is just that the original client will have to poll (as it
does in the v4.0 case) instead of getting a callback when the lock's
available.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Acked-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/nfs/export.c
fs/nfsd/nfs4state.c
include/linux/exportfs.h