Date: Tue, 9 Mar 2021 19:49:26 GMT From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 0dd691b41276 - main - iflib: allow clone detach if not yet init Message-ID: <202103091949.129JnQIb016681@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0dd691b41276ce13d25ffb1443af27f85038aa3f commit 0dd691b41276ce13d25ffb1443af27f85038aa3f Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2021-03-09 12:13:31 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2021-03-09 19:49:13 +0000 iflib: allow clone detach if not yet init If we hit an error during init, then we'll unwind our state and attempt to detach the device -- don't block it. This was discovered by creating a wg0 with missing parameters; said failure ended up leaving this orphaned device in place and ended up panicking the system upon enumeration of the dev.* sysctl space. Reviewed by: gallatin, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29145 --- sys/net/iflib_clone.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/iflib_clone.c b/sys/net/iflib_clone.c index 975873c4a19c..fc4e71806926 100644 --- a/sys/net/iflib_clone.c +++ b/sys/net/iflib_clone.c @@ -83,7 +83,8 @@ iflib_pseudo_detach(device_t dev) if_ctx_t ctx; ctx = device_get_softc(dev); - if ((iflib_get_flags(ctx) & IFC_IN_DETACH) == 0) + if ((iflib_get_flags(ctx) & (IFC_INIT_DONE | IFC_IN_DETACH)) == + IFC_INIT_DONE) return (EBUSY); return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103091949.129JnQIb016681>