linux-stable/fs/nfsd
Chuck Lever a2235bc65a NFSD: Fix possible sleep during nfsd4_release_lockowner()
commit ce3c4ad7f4 upstream.

nfsd4_release_lockowner() holds clp->cl_lock when it calls
check_for_locks(). However, check_for_locks() calls nfsd_file_get()
/ nfsd_file_put() to access the backing inode's flc_posix list, and
nfsd_file_put() can sleep if the inode was recently removed.

Let's instead rely on the stateowner's reference count to gate
whether the release is permitted. This should be a reliable
indication of locks-in-use since file lock operations and
->lm_get_owner take appropriate references, which are released
appropriately when file locks are removed.

Reported-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-06 08:33:51 +02:00
..
acl.h
auth.c
auth.h
blocklayout.c
blocklayoutxdr.c
blocklayoutxdr.h
cache.h nfsd4: make drc_slab global, not per-net 2020-06-24 17:50:37 +02:00
current_stateid.h
export.c
export.h
fault_inject.c
filecache.c nfsd: Containerise filecache laundrette 2022-03-28 08:46:43 +02:00
filecache.h nfsd: Containerise filecache laundrette 2022-03-28 08:46:43 +02:00
flexfilelayout.c
flexfilelayoutxdr.c
flexfilelayoutxdr.h
idmap.h
Kconfig fs: nfsd: fix kconfig dependency warning for NFSD_V4 2021-04-07 14:47:38 +02:00
lockd.c
Makefile
netns.h nfsd4: make drc_slab global, not per-net 2020-06-24 17:50:37 +02:00
nfs2acl.c
nfs3acl.c
nfs3proc.c NFSD: Clamp WRITE offsets 2022-02-16 12:52:47 +01:00
nfs3xdr.c nfsd4: readdirplus shouldn't return parent of export 2021-01-23 15:57:56 +01:00
nfs4acl.c
nfs4callback.c NFSD: fix error handling in NFSv4.0 callbacks 2021-04-07 14:47:39 +02:00
nfs4idmap.c
nfs4layouts.c nfsd: fix delay timer on 32-bit architectures 2020-02-11 04:35:46 -08:00
nfs4proc.c NFSD: Clamp WRITE offsets 2022-02-16 12:52:47 +01:00
nfs4recover.c nfsd: Fix nsfd startup race (again) 2021-12-14 14:49:01 +01:00
nfs4state.c NFSD: Fix possible sleep during nfsd4_release_lockowner() 2022-06-06 08:33:51 +02:00
nfs4xdr.c nfsd4: Handle the NFSv4 READDIR 'dircount' hint being zero 2021-10-13 10:08:17 +02:00
nfscache.c silence nfscache allocation warnings with kvzalloc 2021-10-09 14:39:50 +02:00
nfsctl.c fsnotify: fix fsnotify hooks in pseudo filesystems 2022-02-01 17:24:34 +01:00
nfsd.h nfsd4: fix nfsdfs reference count loop 2020-07-09 09:37:53 +02:00
nfsfh.c
nfsfh.h
nfsproc.c NFSD: prevent underflow in nfssvc_decode_writeargs() 2022-04-15 14:17:59 +02:00
nfssvc.c nfsd: Containerise filecache laundrette 2022-03-28 08:46:43 +02:00
nfsxdr.c
pnfs.h
state.h nfsd: fix jiffies/time_t mixup in LRU list 2020-02-11 04:35:47 -08:00
stats.c
stats.h
trace.c
trace.h NFSD: Fix offset type in I/O trace points 2022-02-16 12:52:47 +01:00
vfs.c nfsd: apply umask on fs without ACL support 2020-07-09 09:37:55 +02:00
vfs.h nfsd: Ensure CLONE persists data and metadata changes to the target file 2019-12-13 08:42:51 +01:00
xdr.h NFSD: prevent underflow in nfssvc_decode_writeargs() 2022-04-15 14:17:59 +02:00
xdr3.h
xdr4.h
xdr4cb.h