The patch titled knfsd: register all RPC programs with portmapper by default has been added to the -mm tree. Its filename is knfsd-register-all-rpc-programs-with-portmapper-by-default.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: knfsd: register all RPC programs with portmapper by default From: Olaf Kirch <okir@xxxxxxx> The NFSACL patches introduced support for multiple RPC services listening on the same transport. However, only the first of these services was registered with portmapper. This was perfectly fine for nfsacl, as you traditionally do not want these to show up in a portmapper listing. The patch below changes the default behavior to always register all services listening on a given transport, but retains the old behavior for nfsacl services. Signed-off-by: Olaf Kirch <okir@xxxxxxx> Signed-off-by: Neil Brown <neilb@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/nfsd/nfs2acl.c | 1 fs/nfsd/nfs3acl.c | 1 include/linux/sunrpc/svc.h | 3 ++ net/sunrpc/svc.c | 37 +++++++++++++++++++++-------------- 4 files changed, 28 insertions(+), 14 deletions(-) diff -puN fs/nfsd/nfs2acl.c~knfsd-register-all-rpc-programs-with-portmapper-by-default fs/nfsd/nfs2acl.c --- a/fs/nfsd/nfs2acl.c~knfsd-register-all-rpc-programs-with-portmapper-by-default +++ a/fs/nfsd/nfs2acl.c @@ -333,4 +333,5 @@ struct svc_version nfsd_acl_version2 = { .vs_proc = nfsd_acl_procedures2, .vs_dispatch = nfsd_dispatch, .vs_xdrsize = NFS3_SVC_XDRSIZE, + .vs_hidden = 1, }; diff -puN fs/nfsd/nfs3acl.c~knfsd-register-all-rpc-programs-with-portmapper-by-default fs/nfsd/nfs3acl.c --- a/fs/nfsd/nfs3acl.c~knfsd-register-all-rpc-programs-with-portmapper-by-default +++ a/fs/nfsd/nfs3acl.c @@ -263,5 +263,6 @@ struct svc_version nfsd_acl_version3 = { .vs_proc = nfsd_acl_procedures3, .vs_dispatch = nfsd_dispatch, .vs_xdrsize = NFS3_SVC_XDRSIZE, + .vs_hidden = 1, }; diff -puN include/linux/sunrpc/svc.h~knfsd-register-all-rpc-programs-with-portmapper-by-default include/linux/sunrpc/svc.h --- a/include/linux/sunrpc/svc.h~knfsd-register-all-rpc-programs-with-portmapper-by-default +++ a/include/linux/sunrpc/svc.h @@ -304,6 +304,9 @@ struct svc_version { struct svc_procedure * vs_proc; /* per-procedure info */ u32 vs_xdrsize; /* xdrsize needed for this version */ + unsigned int vs_hidden : 1; /* Don't register with portmapper. + * Only used for nfsacl so far. */ + /* Override dispatch function (e.g. when caching replies). * A return value of 0 means drop the request. * vs_dispatch == NULL means use default dispatcher. diff -puN net/sunrpc/svc.c~knfsd-register-all-rpc-programs-with-portmapper-by-default net/sunrpc/svc.c --- a/net/sunrpc/svc.c~knfsd-register-all-rpc-programs-with-portmapper-by-default +++ a/net/sunrpc/svc.c @@ -644,23 +644,32 @@ svc_register(struct svc_serv *serv, int unsigned long flags; int i, error = 0, dummy; - progp = serv->sv_program; - - dprintk("RPC: svc_register(%s, %s, %d)\n", - progp->pg_name, proto == IPPROTO_UDP? "udp" : "tcp", port); - if (!port) clear_thread_flag(TIF_SIGPENDING); - for (i = 0; i < progp->pg_nvers; i++) { - if (progp->pg_vers[i] == NULL) - continue; - error = rpc_register(progp->pg_prog, i, proto, port, &dummy); - if (error < 0) - break; - if (port && !dummy) { - error = -EACCES; - break; + for (progp = serv->sv_program; progp; progp = progp->pg_next) { + for (i = 0; i < progp->pg_nvers; i++) { + if (progp->pg_vers[i] == NULL) + continue; + + dprintk("RPC: svc_register(%s, %s, %d, %d)%s\n", + progp->pg_name, + proto == IPPROTO_UDP? "udp" : "tcp", + port, + i, + progp->pg_vers[i]->vs_hidden? + " (but not telling portmap)" : ""); + + if (progp->pg_vers[i]->vs_hidden) + continue; + + error = rpc_register(progp->pg_prog, i, proto, port, &dummy); + if (error < 0) + break; + if (port && !dummy) { + error = -EACCES; + break; + } } } _ Patches currently in -mm which might be from okir@xxxxxxx are origin.patch ipmi-fix-occasional-oops-on-module-unload.patch knfsd-hide-use-of-lockds-h_monitored-flag.patch knfsd-consolidate-common-code-for-statd-lockd-notification.patch knfsd-when-looking-up-a-lockd-host-pass-hostname-length.patch knfsd-lockd-introduce-nsm_handle.patch knfsd-misc-minor-fixes-indentation-changes.patch knfsd-lockd-make-nlm_host_rebooted-use-the-nsm_handle.patch knfsd-lockd-make-the-nsm-upcalls-use-the-nsm_handle.patch knfsd-lockd-make-the-hash-chains-use-a-hlist_node.patch knfsd-lockd-change-list-of-blocked-list-to-list_node.patch knfsd-change-nlm_file-to-use-a-hlist.patch knfsd-lockd-make-nlm_traverse_-more-flexible.patch knfsd-lockd-add-nlm_destroy_host.patch knfsd-lockd-optionally-use-hostnames-for-identifying-peers.patch knfsd-make-nlmclnt_next_cookie-smp-safe.patch knfsd-match-granted_res-replies-using-cookies.patch knfsd-export-nsm_local_state-to-user-space-via-sysctl.patch knfsd-lockd-fix-use-of-h_nextrebind.patch knfsd-register-all-rpc-programs-with-portmapper-by-default.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html