nfsd: fix error handling in write_ports interfaces
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 13 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | nfsd: don't try to shut down nfs4 state handling unless it's upfs/ | +2 | 9 replies | |
| 2/3 | nfsd: fix error handling when starting nfsd with rpcbind downfs/ | +8 | 0 replies | |
| 3/3 | nfsd: fix error handling in __write_ports_addxprtfs/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] nfsd: fix error handling in write_ports interfaces
This patchset fixes some problems with refcounting when there are problems starting up nfsd. The easiest way to reproduce this is to have rpcbind down and then try to start nfsd. The write_ports calls will generally return failure at that point due to the fact that lockd can't register its ports. That leaves the nfsd_serv pointer set, with the sv_threads count set at 0. The first two patches fix this problem.
The third patch, I'm not 100% sure on. It looks correct to me, but the intent of the existing code is not very clear. I know this interface is used by the rdma code, and I may be missing the point of doing it this way. If the existing code is correct as-is, I'll plan to do a patch to add some clarifying comments.
It also seems suspicious to me that __write_ports_addfd/delfd take and put lockd references, but the addxprt/delxprt interfaces do not. If someone were to addfd a socket and then delxprt it, it'll leave a lockd reference dangling.
Should we be taking and putting lockd references in those codepaths as well?
Jeff Layton (3):
nfsd: don't try to shut down nfs4 state handling unless it's up
nfsd: fix error handling when starting nfsd with rpcbind down
nfsd: fix error handling in __write_ports_addxprt
fs/nfsd/nfs4state.c | 2 ++ fs/nfsd/nfsctl.c | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-)