From 8cab6e95ad7a6ad2b91e0e32db5b9f51360c9705 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Sun, 5 Apr 2020 20:10:37 +0200 Subject: [PATCH] endpoint abstr: use userrefs to only issue `zfs holds` if there is at least one hold --- endpoint/endpoint_zfs_abstraction.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/endpoint/endpoint_zfs_abstraction.go b/endpoint/endpoint_zfs_abstraction.go index de3139b..9b28926 100644 --- a/endpoint/endpoint_zfs_abstraction.go +++ b/endpoint/endpoint_zfs_abstraction.go @@ -595,7 +595,7 @@ func listAbstractionsImplFS(ctx context.Context, fs string, query *ListZFSHoldsA if v.Type == zfs.Bookmark && bmE != nil { a = bmE(fsp, v) } - if v.Type == zfs.Snapshot && holdE != nil && query.CreateTXG.Contains(v.GetCreateTXG()) { + if v.Type == zfs.Snapshot && holdE != nil && query.CreateTXG.Contains(v.GetCreateTXG()) && (!v.UserRefs.Valid || v.UserRefs.Value > 0) { holds, err := zfs.ZFSHolds(ctx, fsp.ToString(), v.Name) if err != nil { errCb(err, v.ToAbsPath(fsp), "get hold on snap")