From f87f41009fa1b27318ccc9452c2b83a6c169b502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Fri, 23 Apr 2021 22:41:47 +0200 Subject: [PATCH] zed.d/history_event-zfs-list-cacher.sh: no grep for snapshot detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Tony Hutter Signed-off-by: Ahelenia ZiemiaƄska Closes #11935 --- cmd/zed/zed.d/history_event-zfs-list-cacher.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/zed/zed.d/history_event-zfs-list-cacher.sh.in b/cmd/zed/zed.d/history_event-zfs-list-cacher.sh.in index bf5a121f6a..15f0a8ed61 100755 --- a/cmd/zed/zed.d/history_event-zfs-list-cacher.sh.in +++ b/cmd/zed/zed.d/history_event-zfs-list-cacher.sh.in @@ -14,10 +14,10 @@ FSLIST="${FSLIST_DIR}/${ZEVENT_POOL}" . "${ZED_ZEDLET_DIR}/zed-functions.sh" [ "$ZEVENT_SUBCLASS" != "history_event" ] && exit 0 -zed_check_cmd "${ZFS}" sort diff grep +zed_check_cmd "${ZFS}" sort diff # If we are acting on a snapshot, we have nothing to do -printf '%s' "${ZEVENT_HISTORY_DSNAME}" | grep '@' && exit 0 +[ "${ZEVENT_HISTORY_DSNAME%@*}" = "${ZEVENT_HISTORY_DSNAME}" ] || exit 0 # We obtain a lock on zfs-list to avoid any simultaneous writes. # If we run into trouble, log and drop the lock