From d976ccad0ff7353367a4dc761a7d1b8d97c82ead Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Wed, 6 Oct 2021 16:07:40 -0400 Subject: [PATCH] Use arvados client for /any/path/$id/, not just /mnt/$id/. refs #17996 Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- arvados.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arvados.go b/arvados.go index d4dcf7819e..50ab375f81 100644 --- a/arvados.go +++ b/arvados.go @@ -532,11 +532,8 @@ func open(fnm string) (file, error) { if m == nil { return os.Open(fnm) } - uuid := m[2] - mnt := "/mnt/" + uuid - if fnm != mnt && !strings.HasPrefix(fnm, mnt+"/") { - return os.Open(fnm) - } + collectionUUID := m[2] + collectionPath := fnm[strings.Index(fnm, collectionUUID)+len(collectionUUID):] siteFSMtx.Lock() defer siteFSMtx.Unlock() @@ -556,8 +553,8 @@ func open(fnm string) (file, error) { keepClient.BlockCache.MaxBlocks += 2 } - log.Infof("reading %q from %s using Arvados client", fnm[len(mnt):], uuid) - f, err := siteFS.Open("by_id/" + uuid + fnm[len(mnt):]) + log.Infof("reading %q from %s using Arvados client", collectionPath, collectionUUID) + f, err := siteFS.Open("by_id/" + collectionUUID + collectionPath) if err != nil { return nil, err } -- 2.30.2