Repository: minio/minio (language: go)

Issue:
CPU continues to grow
3-node server. Node a is exposed to receiving API requests. The CPU of node a will continue to grow to 97% utilization. Every time the Minio service is restarted, the CPU will be released. For this problem, no positioning method is found
Binary files are deployed on CentOS 7 server
And / or shared SDA partitions
Version: mini version release 2022-05-19T18-20-59Z
How to locate the problem
![image](https://user-images.githubusercontent.com/31839722/169798709-037b2b5a-9244-4700-bac4-dd294bcc250f.png)
![image](https://user-images.githubusercontent.com/31839722/169799072-b945c169-5abe-45ff-9f3a-977c04c7e0fa.png)



Discussion / hints:
This is the imported pprof file
mc admin profile
[profile.zip](https://github.com/minio/minio/files/8753966/profile.zip)

Seems like there are a bunch of directory listings going on. The caller isn't revealed though.

@Gerrylinux Could you do a profile with `--type=goroutines` as well on a running server with high CPU usage?
Looks like a hot loop is trying to do listings that fails and then instantly retries. May be an internal problem, but I need to see the cause.
Goroutines added
[profile.zip](https://github.com/minio/minio/files/8754189/profile.zip)



Fix patch:
diff --git a/cmd/metacache-set.go b/cmd/metacache-set.go
index 9b5213175e43a..f0c090a4322ee 100644
--- a/cmd/metacache-set.go
+++ b/cmd/metacache-set.go
@@ -882,7 +882,11 @@ func listPathRaw(ctx context.Context, opts listPathRawOptions) (err error) {
 			}
 
 			// fallback only when set.
-			for fd := fallback(werr); fd != nil; {
+			for {
+				fd := fallback(werr)
+				if fd == nil {
+					break
+				}
 				// This fallback is only set when
 				// askDisks is less than total
 				// number of disks per set.


Test patch: