mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
Fixes #1324
This commit is contained in:
parent
33633fd15d
commit
b47d722d8e
10
fs.go
10
fs.go
@ -143,16 +143,16 @@ func removeDuplicateVols(vols []VolInfo) []VolInfo {
|
||||
func getAllUniqueVols(dirPath string) ([]VolInfo, error) {
|
||||
volumeFn := func(dirent fsDirent) bool {
|
||||
// Return all directories.
|
||||
return dirent.IsDir() && isValidVolname(dirent.name)
|
||||
return dirent.IsDir() && isValidVolname(filepath.Clean(dirent.name))
|
||||
}
|
||||
namesOnly := false // Returned dirent names are absolute.
|
||||
namesOnly := true // Returned are only names.
|
||||
dirents, err := scandir(dirPath, volumeFn, namesOnly)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var volsInfo []VolInfo
|
||||
for _, dirent := range dirents {
|
||||
fi, err := os.Stat(dirent.name)
|
||||
fi, err := os.Stat(filepath.Join(dirPath, dirent.name))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -230,7 +230,7 @@ func (s fsStorage) ListVols() (volsInfo []VolInfo, err error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, vol := range volsInfo {
|
||||
for i, vol := range volsInfo {
|
||||
// Volname on case sensitive fs backends can come in as
|
||||
// capitalized, but object layer cannot consume it
|
||||
// directly. Convert it as we see fit.
|
||||
@ -239,7 +239,7 @@ func (s fsStorage) ListVols() (volsInfo []VolInfo, err error) {
|
||||
Name: volName,
|
||||
Created: vol.Created,
|
||||
}
|
||||
volsInfo = append(volsInfo, volInfo)
|
||||
volsInfo[i] = volInfo
|
||||
}
|
||||
return volsInfo, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user