On 8/12/2025 3:02 PM, Olga Kornievskaia wrote:
When a listener is added, a part of creation of transport also registers
program/port with rpcbind. However, when the listener is removed,
while transport goes away, rpcbind still has the entry for that
port/type.
Removal of listeners works by first removing all transports and then
re-adding the ones that were not removed. In addition to destroying
all transports, now also call the function that unregisters everything
with the rpcbind. But we also then need to call the rpcbind setup
function before adding back new transports.
The rpcbind and portmap protocols both define PROC_UNSET procedures
to selectively remove the triplets. Is it not feasible to code a new
client stub to simply invoke them, instead of the legacy big-hammer?
Tom.
Fixes: d093c9089260 ("nfsd: fix management of listener transports")
Signed-off-by: Olga Kornievskaia <okorniev@xxxxxxxxxx>
---
fs/nfsd/nfsctl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 2909d70de559..99d06343117b 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1998,8 +1998,11 @@ int nfsd_nl_listener_set_doit(struct sk_buff *skb, struct genl_info *info)
* Since we can't delete an arbitrary llist entry, destroy the
* remaining listeners and recreate the list.
*/
- if (delete)
+ if (delete) {
svc_xprt_destroy_all(serv, net);
+ svc_rpcb_cleanup(serv, net);
+ svc_bind(serv, net);
+ }
/* walk list of addrs again, open any that still don't exist */
nlmsg_for_each_attr(attr, info->nlhdr, GENL_HDRLEN, rem) {