Merge branch 'master' into support_ssd_volume
This commit is contained in:
@@ -159,7 +159,7 @@ func runCopy(cmd *Command, args []string) bool {
|
||||
defer close(fileCopyTaskChan)
|
||||
for _, fileOrDir := range fileOrDirs {
|
||||
if err := genFileCopyTask(fileOrDir, urlPath, fileCopyTaskChan); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "gen file list error: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "genFileCopyTask : %v\n", err)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ func genFileCopyTask(fileOrDir string, destPath string, fileCopyTaskChan chan Fi
|
||||
|
||||
fi, err := os.Stat(fileOrDir)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Failed to get stat for file %s: %v\n", fileOrDir, err)
|
||||
fmt.Fprintf(os.Stderr, "Error: read file %s: %v\n", fileOrDir, err)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,11 @@ func (fs *FilerServer) autoChunk(ctx context.Context, w http.ResponseWriter, r *
|
||||
reply, md5bytes, err = fs.doPutAutoChunk(ctx, w, r, chunkSize, so)
|
||||
}
|
||||
if err != nil {
|
||||
writeJsonError(w, r, http.StatusInternalServerError, err)
|
||||
if strings.HasPrefix(err.Error(), "read input:") {
|
||||
writeJsonError(w, r, 499, err)
|
||||
} else {
|
||||
writeJsonError(w, r, http.StatusInternalServerError, err)
|
||||
}
|
||||
} else if reply != nil {
|
||||
if len(md5bytes) > 0 {
|
||||
w.Header().Set("Content-MD5", util.Base64Encode(md5bytes))
|
||||
|
||||
@@ -101,12 +101,14 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne
|
||||
}
|
||||
|
||||
// avoid loading one volume more than once
|
||||
l.volumesLock.RLock()
|
||||
_, found := l.volumes[vid]
|
||||
l.volumesLock.RUnlock()
|
||||
if found {
|
||||
l.volumesLock.Lock()
|
||||
if _, found := l.volumes[vid]; found {
|
||||
l.volumesLock.Unlock()
|
||||
glog.V(1).Infof("loaded volume, %v", vid)
|
||||
return true
|
||||
} else {
|
||||
l.volumes[vid] = nil
|
||||
l.volumesLock.Unlock()
|
||||
}
|
||||
|
||||
// load the volume
|
||||
@@ -115,7 +117,7 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne
|
||||
glog.V(0).Infof("new volume %s error %s", volumeName, e)
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
l.SetVolume(vid, v)
|
||||
|
||||
size, _, _ := v.FileStat()
|
||||
|
||||
Reference in New Issue
Block a user