From: Tom Clegg Date: Wed, 6 Oct 2021 20:07:40 +0000 (-0400) Subject: Use arvados client for /any/path/$id/, not just /mnt/$id/. X-Git-Url: https://git.arvados.org/lightning.git/commitdiff_plain/d976ccad0ff7353367a4dc761a7d1b8d97c82ead Use arvados client for /any/path/$id/, not just /mnt/$id/. refs #17996 Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- 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 }