From nobody Mon Jul 10 22:40:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R0JrD4ttLzZNQ0; Mon, 10 Jul 2023 22:41:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R0JrD1FJLz3m2l; Mon, 10 Jul 2023 22:41:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689028860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rTQUR8JhxTPjRmHnykzkU1u5Ziw9sPEezpGS3KTj7pw=; b=amjo9khy8H/ewl8/bzg4pTfo67HThjpUG/EEBE59wad/ewBUwKNjfjjdJaLTyr+PfZKJnv UGPa4weK4RWhLBWaYaSrhfwK6fPoDeY7zlQP69u5hXyup6NVbc562iK1W1TajBqv7nzrXn 5N+P7q4LBon+/1x1M2POQPnErAk1x99sJB5EH0GDhC6Kf1wtTiLSaDs+0+D3iGPIpHjHli Xaj+V7PojJIs+pM2EC98S8GB6EoB3xdWVo9/hCrcP+TlXaanN+tvZIFcIx6iujUMbfjUzo Oy0+h3FAGFWjvgbCMKfJNrOirbb0LI/cpI9kmjxbKTr5o4VgCsLmQY+tL+QN9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689028860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rTQUR8JhxTPjRmHnykzkU1u5Ziw9sPEezpGS3KTj7pw=; b=ulhx1K1TUy7+WgPV155PWAlaO4CHjx3XDABnZ+vIEywXBP3ow1FAlEAtwUWI4/J8Uz4UXM 91XZiCono6o0FLnH2XZxUfSDFjk6TvRSOHBxXLQq4M3Jn6IQYQDH4QPWYQa/DCQr8dz5ny OVewoKbyJNtCEehOjC2D0X3DXUlhe2VhdlE6qNnzSmefB7Bf53+/V5plhLBjiCUnBW9UHn 4nZS5veuNHYUhoS1tDyLxTceG7MvvA98aO5BUx6FUhDlAItI+W9q7JVAV3aAubL383VbsZ ReSFDa6dFJwm80Q+r4LMAguzIvzlV6y+qlFuHWrRccDho5zQ38D9AmLp/5NqFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689028860; a=rsa-sha256; cv=none; b=cAFyaf8wF1SIQuSrKeiTCoYylVIv4RmOvKKtY5jhmjjW9Kb8T2fwg71iyp+3Ex/RuDvTML boCcMCP3hCuYC9W11WAHQ4AhYZkHxN1CIIneIaEM/I98QGsXR0Q8Zg6R8BKdgpA/1ifkcc MLhzkP88WrL6MvT2oJJm/Y4CTyQ2yLW0P9lvFsmt78l7PgP3C7FJ+CDWncck2+TmXMKH2H 8GdAxd2mHAA50035b/FO0rUZfd0jVcOuEAArAiQxjhs6emXMteq1n6NzM2Vgi3YBvvIsxL 8+YDW3qLCJNA2fKehhKLpGOpEBK1AUGgJSK8hOei/frWWoP3fEf715WYI0GEtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R0JrD0Jy2z12bL; Mon, 10 Jul 2023 22:41:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36AMexYd075926; Mon, 10 Jul 2023 22:40:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36AMex5S075925; Mon, 10 Jul 2023 22:40:59 GMT (envelope-from git) Date: Mon, 10 Jul 2023 22:40:59 GMT Message-Id: <202307102240.36AMex5S075925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 92642bba4db4 - main - zfsd: listen for sysevent.fs.zfs instead of misc.fs.zfs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92642bba4db4bf1719758ac7233468bc09a0bd59 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=92642bba4db4bf1719758ac7233468bc09a0bd59 commit 92642bba4db4bf1719758ac7233468bc09a0bd59 Author: Alan Somers AuthorDate: 2023-04-03 21:45:55 +0000 Commit: Alan Somers CommitDate: 2023-07-10 22:36:57 +0000 zfsd: listen for sysevent.fs.zfs instead of misc.fs.zfs At some point the names of these devd events changed. Probably it happened when importing OpenZFS. Before that, FreeBSD's sysevent_alloc method didn't create a "class" nvpair in the event, which led to log_sysevent using the event's ev_subclass field as its type. MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D39437 --- cddl/usr.sbin/zfsd/case_file.cc | 6 +++--- cddl/usr.sbin/zfsd/zfsd.cc | 2 +- cddl/usr.sbin/zfsd/zfsd_event.cc | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cddl/usr.sbin/zfsd/case_file.cc b/cddl/usr.sbin/zfsd/case_file.cc index 5064d3c266dd..ef4d592b9602 100644 --- a/cddl/usr.sbin/zfsd/case_file.cc +++ b/cddl/usr.sbin/zfsd/case_file.cc @@ -388,7 +388,7 @@ CaseFile::ReEvaluate(const ZfsEvent &event) { bool consumed(false); - if (event.Value("type") == "misc.fs.zfs.vdev_remove") { + if (event.Value("type") == "sysevent.fs.zfs.vdev_remove") { /* * The Vdev we represent has been removed from the * configuration. This case is no longer of value. @@ -396,12 +396,12 @@ CaseFile::ReEvaluate(const ZfsEvent &event) Close(); return (/*consumed*/true); - } else if (event.Value("type") == "misc.fs.zfs.pool_destroy") { + } else if (event.Value("type") == "sysevent.fs.zfs.pool_destroy") { /* This Pool has been destroyed. Discard the case */ Close(); return (/*consumed*/true); - } else if (event.Value("type") == "misc.fs.zfs.config_sync") { + } else if (event.Value("type") == "sysevent.fs.zfs.config_sync") { RefreshVdevState(); if (VdevState() < VDEV_STATE_HEALTHY) consumed = ActivateSpare(); diff --git a/cddl/usr.sbin/zfsd/zfsd.cc b/cddl/usr.sbin/zfsd/zfsd.cc index 29c6b1ae22e2..16c02203b66b 100644 --- a/cddl/usr.sbin/zfsd/zfsd.cc +++ b/cddl/usr.sbin/zfsd/zfsd.cc @@ -248,7 +248,7 @@ ZfsDaemon::BuildCaseFiles() snprintf(evString, 160, "!system=ZFS subsystem=ZFS " - "type=misc.fs.zfs.config_sync sub_type=synthesized " + "type=sysevent.fs.zfs.config_sync sub_type=synthesized " "pool_name=%s pool_guid=%" PRIu64 "\n", poolname, poolGUID); event = Event::CreateEvent(GetFactory(), string(evString)); if (event != NULL) { diff --git a/cddl/usr.sbin/zfsd/zfsd_event.cc b/cddl/usr.sbin/zfsd/zfsd_event.cc index 45fc7adbb31b..5391aeb2997f 100644 --- a/cddl/usr.sbin/zfsd/zfsd_event.cc +++ b/cddl/usr.sbin/zfsd/zfsd_event.cc @@ -285,7 +285,7 @@ ZfsEvent::Process() const } /* On config syncs, replay any queued events first. */ - if (Value("type").find("misc.fs.zfs.config_sync") == 0) { + if (Value("type").find("sysevent.fs.zfs.config_sync") == 0) { /* * Even if saved events are unconsumed the second time * around, drop them. Any events that still can't be @@ -296,7 +296,7 @@ ZfsEvent::Process() const CaseFile::ReEvaluateByGuid(PoolGUID(), *this); } - if (Value("type").find("misc.fs.zfs.") == 0) { + if (Value("type").find("sysevent.fs.zfs.") == 0) { /* Configuration changes, resilver events, etc. */ ProcessPoolEvent(); return (false); @@ -409,7 +409,7 @@ ZfsEvent::ProcessPoolEvent() const bool degradedDevice(false); /* The pool is destroyed. Discard any open cases */ - if (Value("type") == "misc.fs.zfs.pool_destroy") { + if (Value("type") == "sysevent.fs.zfs.pool_destroy") { Log(LOG_INFO); CaseFile::ReEvaluateByGuid(PoolGUID(), *this); return; @@ -424,7 +424,7 @@ ZfsEvent::ProcessPoolEvent() const Log(LOG_INFO); caseFile->ReEvaluate(*this); } - else if (Value("type") == "misc.fs.zfs.resilver_finish") + else if (Value("type") == "sysevent.fs.zfs.resilver_finish") { /* * It's possible to get a resilver_finish event with no @@ -435,7 +435,7 @@ ZfsEvent::ProcessPoolEvent() const CleanupSpares(); } - if (Value("type") == "misc.fs.zfs.vdev_remove" + if (Value("type") == "sysevent.fs.zfs.vdev_remove" && degradedDevice == false) { /* See if any other cases can make use of this device. */