From 55375cc9e758a55e33774d4968ffad0ca075dfdb Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 15 Feb 2026 11:06:34 -0800 Subject: [PATCH] Fix the ZFS hook to support datasets with a "canmount" property of "noauto" (#1269). --- NEWS | 1 + borgmatic/hooks/data_source/zfs.py | 2 +- tests/end-to-end/commands/fake_zfs.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 1d854410..b6e204b0 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ handy for fetching borgmatic configuration from external scripts. See the documentation for more information: https://torsion.org/borgmatic/reference/command-line/actions/config-show/ + * #1269: Fix the ZFS hook to support datasets with a "canmount" property of "noauto". 2.1.2 * #1231: If a source file is deleted during a "spot" check, consider the file as non-matching diff --git a/borgmatic/hooks/data_source/zfs.py b/borgmatic/hooks/data_source/zfs.py index 40ae25d4..f8eb840a 100644 --- a/borgmatic/hooks/data_source/zfs.py +++ b/borgmatic/hooks/data_source/zfs.py @@ -71,7 +71,7 @@ def get_datasets_to_backup(zfs_command, patterns): ) # Skip datasets that are marked "canmount=off", because mounting their snapshots will # result in completely empty mount points—thereby preventing us from backing them up. - if can_mount == 'on' + if can_mount != 'off' ), key=lambda dataset: dataset.mount_point, reverse=True, diff --git a/tests/end-to-end/commands/fake_zfs.py b/tests/end-to-end/commands/fake_zfs.py index 4ef3f498..cceaf59d 100644 --- a/tests/end-to-end/commands/fake_zfs.py +++ b/tests/end-to-end/commands/fake_zfs.py @@ -35,7 +35,7 @@ BUILTIN_DATASETS = ( 'used': '256K', 'avail': '23.7M', 'refer': '25K', - 'canmount': 'on', + 'canmount': 'noauto', 'mountpoint': '/e2e/pool/dataset', }, )