mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
fix: log if there is readDir() failure with ListBuckets (#15461)
This is actionable and must be logged. Bonus: also honor umask by using 0o666 for all Open() syscalls.
This commit is contained in:
@@ -751,18 +751,24 @@ func (s *xlStorage) MakeVol(ctx context.Context, volume string) error {
|
||||
}
|
||||
|
||||
// ListVols - list volumes.
|
||||
func (s *xlStorage) ListVols(context.Context) (volsInfo []VolInfo, err error) {
|
||||
return listVols(s.diskPath)
|
||||
func (s *xlStorage) ListVols(ctx context.Context) (volsInfo []VolInfo, err error) {
|
||||
return listVols(ctx, s.diskPath)
|
||||
}
|
||||
|
||||
// List all the volumes from diskPath.
|
||||
func listVols(dirPath string) ([]VolInfo, error) {
|
||||
func listVols(ctx context.Context, dirPath string) ([]VolInfo, error) {
|
||||
if err := checkPathLength(dirPath); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
entries, err := readDir(dirPath)
|
||||
if err != nil {
|
||||
return nil, errDiskNotFound
|
||||
logger.LogIf(ctx, err)
|
||||
if errors.Is(err, errFileAccessDenied) {
|
||||
return nil, errDiskAccessDenied
|
||||
} else if errors.Is(err, errFileNotFound) {
|
||||
return nil, errDiskNotFound
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
volsInfo := make([]VolInfo, 0, len(entries))
|
||||
for _, entry := range entries {
|
||||
|
||||
Reference in New Issue
Block a user