From c9350149d8b325ed99262d5e43eb52ece2708134 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 8 Sep 2023 15:29:44 +0100 Subject: [PATCH] hdfs: fix uploading to the wrong object on Update with overriden remote name In this commit we discovered a problem with objects being uploaded to the incorrect object name. It added an integration test for the problem. 65b2e378e0992d65 drive: fix incorrect remote after Update on object This test was tripped by the hdfs backend and this patch fixes the problem. --- backend/hdfs/object.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/hdfs/object.go b/backend/hdfs/object.go index 976bc7f02..31c8282f8 100644 --- a/backend/hdfs/object.go +++ b/backend/hdfs/object.go @@ -106,7 +106,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update object func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { - realpath := o.fs.realpath(src.Remote()) + realpath := o.fs.realpath(o.remote) dirname := path.Dir(realpath) fs.Debugf(o.fs, "update [%s]", realpath)