Обновить internal/endpoint/endpoint.go

This commit is contained in:
2026-07-16 08:30:05 +03:00
parent d916c93cf9
commit a6d4d55b83
+15
View File
@@ -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
}