mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Moving os.MkdirAll() inside atomic for auto parent directory creates
This commit is contained in:
@@ -153,13 +153,7 @@ func (disk Disk) CreateFile(filename string) (*atomic.File, error) {
|
||||
return nil, iodine.New(InvalidArgument{}, nil)
|
||||
}
|
||||
|
||||
filePath := filepath.Join(disk.path, filename)
|
||||
// Create directories if they don't exist
|
||||
if err := os.MkdirAll(filepath.Dir(filePath), 0700); err != nil {
|
||||
return nil, iodine.New(err, nil)
|
||||
}
|
||||
|
||||
f, err := atomic.FileCreate(filePath)
|
||||
f, err := atomic.FileCreate(filepath.Join(disk.path, filename))
|
||||
if err != nil {
|
||||
return nil, iodine.New(err, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user