Subject: Clarify module API boundaries
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest14 patches 0 repliesNew
- v314 patches 0 repliesSuperseded
- v242 patches 8 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 36 patches | 2 replies | Superseded |
Changes in v4 from the cover letter
- Address a build failure due to header reorganization
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | lockd: Simplify cast_status() in svcproc.cfs/ | +19 | 0 replies | |
| 2/14 | lockd: Relocate and rename nlm_drop_replyfs/ fs/ fs/ +3 more | +38 | 0 replies | |
| 3/14 | lockd: Introduce nlm__int__deadlockfs/ fs/ fs/ +1 more | +13 | 0 replies | |
| 4/14 | lockd: Have nlm_fopen() return errno valuesfs/ fs/ fs/ +3 more | +82 | 0 replies | |
| 5/14 | lockd: Relocate nlmsvc_unlock API declarationsfs/ include/ include/ | +8 | 0 replies | |
| 6/14 | NFS: Use nlmclnt_shutdown_rpc_clnt() to safely shut down NLMfs/ fs/ include/ | +32 | 0 replies | |
| 7/14 | lockd: Move xdr4.h from include/linux/lockd/ to fs/lockd/fs/ fs/ fs/ +3 more | +12 | 0 replies | |
| 8/14 | lockd: Move share.h from include/linux/lockd/ to fs/lockd/fs/ fs/ fs/ +3 more | +12 | 0 replies | |
| 9/14 | lockd: Relocate include/linux/lockd/lockd.hfs/ fs/ fs/ +13 more | +22 | 0 replies | |
| 10/14 | lockd: Remove lockd/debug.hfs/ include/ | +23 | 0 replies | |
| 11/14 | lockd: Move xdr.h from include/linux/lockd/ to fs/lockd/fs/ fs/ fs/ +1 more | +7 | 0 replies | |
| 12/14 | lockd: Make linux/lockd/nlm.h an internal headerfs/ fs/ fs/ +1 more | +4 | 0 replies | |
| 13/14 | lockd: Move nlm4svc_set_file_lock_range()fs/ fs/ fs/ +1 more | +27 | 0 replies | |
| 14/14 | lockd: Relocate svc_version definitions to XDR layerfs/ fs/ fs/ +2 more | +74 | 0 replies |
Reviews trailers per patch
13 of 14 patches have a Reviewed-by or Acked-by.
| Patch | Jeff Layton |
|---|---|
| 1/14 | R-b |
| 2/14 | |
| 3/14 | R-b |
| 4/14 | R-b |
| 5/14 | R-b |
| 6/14 | R-b |
| 7/14 | R-b |
| 8/14 | R-b |
| 9/14 | R-b |
| 10/14 | R-b |
| 11/14 | R-b |
| 12/14 | R-b |
| 13/14 | R-b |
| 14/14 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 00/14] Subject: Clarify module API boundaries
From: Chuck Lever <[email protected]>
The patches in this series refactor the lockd code base to clearly separate its public API from internal implementation and NLM protocol details.
As context, the patches in this series are pre-requisite to the XDR changes posted earlier:
https://lore.kernel.org/linux-nfs/[email protected]/T/#t
The lockd subsystem currently exposes internal implementation headers through include/linux/lockd/, creating implicit API contracts that complicate maintenance. External consumers such as NFSD and the NFS client have developed dependencies on internal structures like struct nlm_host, and wire protocol constants leak into high-level module interfaces.
These patches work to establish clean architectural boundaries. The public API in include/linux/lockd/ is reduced to bind.h and nlm.h, which define the contract between lockd and its consumers. Private implementation details including XDR definitions, share management, and host structures are relocated to fs/lockd/ where they belong. Layering violations are corrected: the NFS client now uses accessor helpers instead of dereferencing internal structures, and nlm_fopen() returns errno values instead of wire protocol codes.
These changes enable subsequent work to modernize the NLMv4 XDR layer using xdrgen without risk of breaking external consumers. This work appears in the remaining patches in this series, which are presented here only to provide context for the API adjustments. No need to review those closely just yet.
The series is based on the public nfsd-testing branch.
---
Changes since v3:
- Address a build failure due to header reorganization
Changes since v2:
- Serialize client-side NLM shutdown to avoid UAF and NPD
- Address a build failure due to header reorganization
- Rename internal status code nlm_drop_reply
Changes since v1:
- Refine the pre-requisite header adjustments
- Reduce stack consumption by moving large structures to wrappers
- Additional extensive clean up
Chuck Lever (14):
lockd: Simplify cast_status() in svcproc.c
lockd: Relocate and rename nlm_drop_reply
lockd: Introduce nlm__int__deadlock
lockd: Have nlm_fopen() return errno values
lockd: Relocate nlmsvc_unlock API declarations
NFS: Use nlmclnt_shutdown_rpc_clnt() to safely shut down NLM
lockd: Move xdr4.h from include/linux/lockd/ to fs/lockd/
lockd: Move share.h from include/linux/lockd/ to fs/lockd/
lockd: Relocate include/linux/lockd/lockd.h
lockd: Remove lockd/debug.h
lockd: Move xdr.h from include/linux/lockd/ to fs/lockd/
lockd: Make linux/lockd/nlm.h an internal header
lockd: Move nlm4svc_set_file_lock_range()
lockd: Relocate svc_version definitions to XDR layer
fs/lockd/clnt4xdr.c | 7 +-
fs/lockd/clntlock.c | 2 +-
fs/lockd/clntproc.c | 2 +-
fs/lockd/clntxdr.c | 3 +-
fs/lockd/host.c | 31 +++++++-
{include/linux => fs}/lockd/lockd.h | 94 +++++++++++++++++-----
fs/lockd/mon.c | 2 +-
{include/linux => fs}/lockd/nlm.h | 8 +-
{include/linux => fs}/lockd/share.h | 8 +-
fs/lockd/svc.c | 50 +++---------
fs/lockd/svc4proc.c | 77 ++++++++++++++----
fs/lockd/svclock.c | 16 ++--
fs/lockd/svcproc.c | 119 ++++++++++++++++++++--------
fs/lockd/svcshare.c | 5 +-
fs/lockd/svcsubs.c | 32 ++++++--
fs/lockd/trace.h | 3 +-
fs/lockd/xdr.c | 3 +-
{include/linux => fs}/lockd/xdr.h | 15 +---
fs/lockd/xdr4.c | 16 +---
{include/linux => fs}/lockd/xdr4.h | 16 +---
fs/nfs/nfs3proc.c | 1 +
fs/nfs/sysfs.c | 4 +-
fs/nfsd/lockd.c | 50 +++++++-----
fs/nfsd/nfsctl.c | 2 +-
include/linux/lockd/bind.h | 26 +++---
include/linux/lockd/debug.h | 40 ----------
26 files changed, 368 insertions(+), 264 deletions(-)
rename {include/linux => fs}/lockd/lockd.h (85%)
rename {include/linux => fs}/lockd/nlm.h (91%)
rename {include/linux => fs}/lockd/share.h (85%)
rename {include/linux => fs}/lockd/xdr.h (91%)
rename {include/linux => fs}/lockd/xdr4.h (80%)
delete mode 100644 include/linux/lockd/debug.hSignature · 1 line
2.52.0