Skip to content

Commit

Permalink
One more fix after commit 184b850
Browse files Browse the repository at this point in the history
See prev commit for details.
  • Loading branch information
dsh2dsh committed Nov 24, 2024
1 parent b8235e7 commit 6168946
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/endpoint/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ func listFilesystemsRecursive(ctx context.Context, root *zfs.DatasetPath,
return cmp.Compare(a.Order(), b.Order())
})

fss, err := makeFilesystems(ctx, root, sortedProps)
fss, err := makeFilesystems(ctx, root, includingRoot, sortedProps)
if err != nil {
return nil, err
} else if len(fss) == 0 {
Expand All @@ -729,7 +729,7 @@ func listFilesystemsRecursive(ctx context.Context, root *zfs.DatasetPath,
}

func makeFilesystems(ctx context.Context, root *zfs.DatasetPath,
items []*zfs.ZFSProperties,
includingRoot bool, items []*zfs.ZFSProperties,
) ([]*pdu.Filesystem, error) {
// present filesystem without the root_fs prefix
fss := make([]*pdu.Filesystem, 0, len(items))
Expand Down Expand Up @@ -759,7 +759,10 @@ func makeFilesystems(ctx context.Context, root *zfs.DatasetPath,
}
l.WithField("receive_resume_token", token).Debug("receive resume token")

p.TrimPrefix(root)
if !includingRoot {
p.TrimPrefix(root)
}

fss = append(fss, &pdu.Filesystem{
Path: p.ToString(),
IsPlaceholder: state.IsPlaceholder,
Expand Down

0 comments on commit 6168946

Please sign in to comment.