diff --git a/internal/endpoint/endpoint.go b/internal/endpoint/endpoint.go index d8cf736..de43c06 100644 --- a/internal/endpoint/endpoint.go +++ b/internal/endpoint/endpoint.go @@ -643,7 +643,22 @@ func (f subroot) MapToLocal(fs string) (*zfs.DatasetPath, error) { if p.Length() == 0 { return nil, errors.Errorf("cannot map empty filesystem") } + + // Патч: убираем pool name из source пути + if p.Length() > 1 { + subpath := p.Copy() + subpath.TrimNPrefixComps(1) // удаляем hdd_9XG1J9J1 + p = subpath + } + + // Дополнительно: если localRoot содержит client_identity (172.16.11.5), убираем его c := f.localRoot.Copy() + if c.Length() > 1 { + rootOnly := c.Copy() + rootOnly.TrimNPrefixComps(c.Length() - 1) // оставляем только chunk_9XG1J8T0 + c = rootOnly + } + c.Extend(p) return c, nil }