From 1358894d5fbcac2695355d21a8f7ebff0fa9d694 Mon Sep 17 00:00:00 2001 From: adminer Date: Fri, 17 Jul 2026 23:06:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20internal/endpoint/endpoint.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/endpoint/endpoint.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/internal/endpoint/endpoint.go b/internal/endpoint/endpoint.go index 6f45119..54cc6a9 100644 --- a/internal/endpoint/endpoint.go +++ b/internal/endpoint/endpoint.go @@ -158,17 +158,11 @@ func (s *Sender) ListFilesystems(ctx context.Context, r *pdu.ListFilesystemReq) return res, nil } -func (s *Sender) ListFilesystemVersions(ctx context.Context, r *pdu.ListFilesystemVersionsReq) (*pdu.ListFilesystemVersionsRes, error) { +func (s *Receiver) ListFilesystemVersions(ctx context.Context, req *pdu.ListFilesystemVersionsReq) (*pdu.ListFilesystemVersionsRes, error) { defer trace.WithSpanFromStackUpdateCtx(&ctx)() - // Патч: приводим путь к виду без pool, если пришёл "чистый" путь - fsForFilter := r.GetFilesystem() - p, _ := zfs.NewDatasetPath(fsForFilter) - if p.Length() <= 1 && !strings.Contains(fsForFilter, "/") { - // если путь уже короткий — используем фильтр как есть - } - - lp, err := s.filterCheckFS(r.GetFilesystem()) + root := s.clientRootFromCtx(ctx) + lp, err := subroot{root}.MapToLocal(req.GetFilesystem()) if err != nil { return nil, err } @@ -661,14 +655,14 @@ func (f subroot) MapToLocal(fs string) (*zfs.DatasetPath, error) { return nil, errors.Errorf("cannot map empty filesystem") } - // Убираем pool name из source (hdd_...) + // Убираем pool из source if p.Length() > 1 { subpath := p.Copy() subpath.TrimNPrefixComps(1) p = subpath } - // Всегда оставляем только root (chunk_9XG1J8T0) + // Оставляем только chunk_9XG1J8T0 c := f.localRoot.Copy() if c.Length() > 1 { rootOnly := c.Copy()