ignore if volume exists in MakeVolBulk, return other errors (#13866)

This commit is contained in:
Harshavardhana 2021-12-09 15:55:42 -08:00 committed by GitHub
parent 85d2df02b9
commit 3b79f7e4ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -679,10 +679,8 @@ func (s *xlStorage) SetDiskID(id string) {
func (s *xlStorage) MakeVolBulk(ctx context.Context, volumes ...string) error {
for _, volume := range volumes {
if err := s.MakeVol(ctx, volume); err != nil {
if errors.Is(err, errDiskAccessDenied) {
return errDiskAccessDenied
}
if err := s.MakeVol(ctx, volume); err != nil && !errors.Is(err, errVolumeExists) {
return err
}
}
return nil