]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lockd: don't allow locking on reexported NFSv2/3
authorJeff Layton <jlayton@kernel.org>
Thu, 23 Oct 2025 13:12:39 +0000 (09:12 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 20 Nov 2025 21:29:35 +0000 (16:29 -0500)
commit898f94465205e33295c29333a82a249b8f90aa74
treed6ca447fd3f1fcb76361d9326f8783258a726bd5
parentf6dcad1d748e192d8cd01d76736131ae913787af
lockd: don't allow locking on reexported NFSv2/3

Since commit 9254c8ae9b81 ("nfsd: disallow file locking and delegations
for NFSv4 reexport"), file locking when reexporting an NFS mount via
NFSv4 is expressly prohibited by nfsd. Do the same in lockd:

Add a new  nlmsvc_file_cannot_lock() helper that will test whether file
locking is allowed for a given file, and return nlm_lck_denied_nolocks
if it isn't.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Olga Kornievskaia <okorniev@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svclock.c
fs/lockd/svcshare.c
include/linux/lockd/lockd.h