|
|
@ -2224,10 +2224,7 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath, dataDir, |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if err = renameAll(srcFilePath, dstFilePath); err != nil { |
|
|
|
// Commit data
|
|
|
|
return osErrToFileErr(err) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if srcDataPath != "" { |
|
|
|
if srcDataPath != "" { |
|
|
|
removeAll(oldDstDataPath) |
|
|
|
removeAll(oldDstDataPath) |
|
|
|
removeAll(dstDataPath) |
|
|
|
removeAll(dstDataPath) |
|
|
@ -2236,6 +2233,11 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath, dataDir, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Commit meta-file
|
|
|
|
|
|
|
|
if err = renameAll(srcFilePath, dstFilePath); err != nil { |
|
|
|
|
|
|
|
return osErrToFileErr(err) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Remove parent dir of the source file if empty
|
|
|
|
// Remove parent dir of the source file if empty
|
|
|
|
if parentDir := slashpath.Dir(srcFilePath); isDirEmpty(parentDir) { |
|
|
|
if parentDir := slashpath.Dir(srcFilePath); isDirEmpty(parentDir) { |
|
|
|
deleteFile(srcVolumeDir, parentDir, false) |
|
|
|
deleteFile(srcVolumeDir, parentDir, false) |
|
|
|