|
|
|
@ -19,6 +19,7 @@ package cmd |
|
|
|
|
import ( |
|
|
|
|
"bytes" |
|
|
|
|
"context" |
|
|
|
|
"errors" |
|
|
|
|
"fmt" |
|
|
|
|
"io" |
|
|
|
|
"io/ioutil" |
|
|
|
@ -622,9 +623,16 @@ func (fs *FSObjects) CopyObject(ctx context.Context, srcBucket, srcObject, dstBu |
|
|
|
|
fsMetaPath := pathJoin(fs.fsPath, minioMetaBucket, bucketMetaPrefix, srcBucket, srcObject, fs.metaJSONFile) |
|
|
|
|
wlk, err := fs.rwPool.Write(fsMetaPath) |
|
|
|
|
if err != nil { |
|
|
|
|
if !errors.Is(err, errFileNotFound) { |
|
|
|
|
logger.LogIf(ctx, err) |
|
|
|
|
return oi, toObjectErr(err, srcBucket, srcObject) |
|
|
|
|
} |
|
|
|
|
wlk, err = fs.rwPool.Create(fsMetaPath) |
|
|
|
|
if err != nil { |
|
|
|
|
logger.LogIf(ctx, err) |
|
|
|
|
return oi, toObjectErr(err, srcBucket, srcObject) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// This close will allow for locks to be synchronized on `fs.json`.
|
|
|
|
|
defer wlk.Close() |
|
|
|
|
|
|
|
|
@ -1491,9 +1499,16 @@ func (fs *FSObjects) PutObjectTags(ctx context.Context, bucket, object string, t |
|
|
|
|
fsMeta := fsMetaV1{} |
|
|
|
|
wlk, err := fs.rwPool.Write(fsMetaPath) |
|
|
|
|
if err != nil { |
|
|
|
|
if !errors.Is(err, errFileNotFound) { |
|
|
|
|
logger.LogIf(ctx, err) |
|
|
|
|
return toObjectErr(err, bucket, object) |
|
|
|
|
} |
|
|
|
|
wlk, err = fs.rwPool.Create(fsMetaPath) |
|
|
|
|
if err != nil { |
|
|
|
|
logger.LogIf(ctx, err) |
|
|
|
|
return toObjectErr(err, bucket, object) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// This close will allow for locks to be synchronized on `fs.json`.
|
|
|
|
|
defer wlk.Close() |
|
|
|
|
|
|
|
|
|