summaryrefslogtreecommitdiff
path: root/Documentation/netlink
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2026-04-19 14:53:02 -0400
committerChuck Lever <cel@kernel.org>2026-06-09 16:32:59 -0400
commit978cda83de411fcbff22ac5b2b0024cae7df806f (patch)
tree2e1ada501f3502d81a7e22bf852f4de8aea4ddb0 /Documentation/netlink
parent0a7c2aa5844c9ad57bee914d46bc1f84b2fd96a0 (diff)
NFSD: Add NFSD_CMD_UNLOCK_IP netlink command
The existing write_unlock_ip procfs interface releases NLM file locks held by a specific client IP address, but procfs provides no structured way to extend that operation to other scopes such as revoking NFSv4 state. Add NFSD_CMD_UNLOCK_IP as a dedicated netlink command for releasing NLM locks by client address. The command accepts a binary sockaddr_in or sockaddr_in6 in its address attribute. The handler validates the address family and length, then calls nlmsvc_unlock_all_by_ip() to release matching NLM locks. Because lockd is a single global instance, that call operates across all network namespaces regardless of which namespace the caller inhabits. A separate netlink command for filesystem-scoped unlock is added in a subsequent commit. The nfsd_ctl_unlock_ip tracepoint is updated from string-based address logging to __sockaddr, which stores the binary sockaddr and formats it with %pISpc. This affects both the new netlink path and the existing procfs write_unlock_ip path, giving consistent structured output in both cases. Reviewed-by: Jeff Layton <jlayton@kernel.org> Tested-by: Dai Ngo <dai.ngo@oracle.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'Documentation/netlink')
-rw-r--r--Documentation/netlink/specs/nfsd.yaml18
1 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/netlink/specs/nfsd.yaml b/Documentation/netlink/specs/nfsd.yaml
index 25497b533185..bf41682464c3 100644
--- a/Documentation/netlink/specs/nfsd.yaml
+++ b/Documentation/netlink/specs/nfsd.yaml
@@ -301,6 +301,15 @@ attribute-sets:
type: u32
enum: cache-type
enum-as-flags: true
+ -
+ name: unlock-ip
+ attributes:
+ -
+ name: address
+ type: binary
+ doc: struct sockaddr_in or struct sockaddr_in6.
+ checks:
+ min-len: 16
operations:
list:
@@ -455,6 +464,15 @@ operations:
request:
attributes:
- mask
+ -
+ name: unlock-ip
+ doc: release NLM locks held by an IP address
+ attribute-set: unlock-ip
+ flags: [admin-perm]
+ do:
+ request:
+ attributes:
+ - address
mcast-groups:
list: