Date: Sun, 28 Mar 2021 19:04:13 GMT From: Brandon Bergren <bdragon@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 98727c6cd11e - main - Fix panic when using BOOTP to resolve root path. Message-ID: <202103281904.12SJ4D4x062518@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=98727c6cd11edb10617be0f421e485e0223185a5 commit 98727c6cd11edb10617be0f421e485e0223185a5 Author: Brandon Bergren <bdragon@FreeBSD.org> AuthorDate: 2021-03-28 00:18:51 +0000 Commit: Brandon Bergren <bdragon@FreeBSD.org> CommitDate: 2021-03-28 19:02:40 +0000 Fix panic when using BOOTP to resolve root path. When loading a direct-boot kernel, a temporary route is being installed, the NFS handle is acquired, and the temporary route is removed again. This was being done inside a net epoch, but since the krpc code is written using blocking APIs, we can't actually do that, because sleeping is not allowed during a net epoch. Exit and reenter the epoch so we are only in the epoch when doing the routing table manipulation. Fixes panic when booting my RB800 over NFS (where the kernel is loaded using RouterBOOT directly.) Reviewed by: melifaro Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D29464 --- sys/nfs/bootp_subr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c index fd0e0653a02c..2386a23084da 100644 --- a/sys/nfs/bootp_subr.c +++ b/sys/nfs/bootp_subr.c @@ -1682,9 +1682,11 @@ retry: NET_EPOCH_ENTER(et); bootpc_add_default_route(ifctx); + NET_EPOCH_EXIT(et); error = md_mount(&nd->root_saddr, nd->root_hostnam, nd->root_fh, &nd->root_fhsize, &nd->root_args, td); + NET_EPOCH_ENTER(et); bootpc_remove_default_route(ifctx); NET_EPOCH_EXIT(et); if (error != 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103281904.12SJ4D4x062518>