fix(blobnode): only parse files with the .iostat suffix for blobnode iostat

Problem: error: invalid iostat file
RootCause: there are unexpected files from other processes
  in directories /tmp/shm or /dev/shm

. #1001088459

Signed-off-by: zhangjianwei2 <zhangjianwei2@cmss.chinamobile.com>
This commit is contained in:
zhangjianwei2 2026-07-24 20:42:14 +08:00 committed by slasher
parent 6d424e5ef5
commit d5b0b72e81

View File

@ -26,6 +26,7 @@ import (
"github.com/desertbit/grumble"
"github.com/cubefs/cubefs/blobstore/blobnode/base/flow"
"github.com/cubefs/cubefs/blobstore/cli/common/fmt"
"github.com/cubefs/cubefs/blobstore/common/iostat"
)
@ -158,6 +159,10 @@ func scanVDevices(dir string, filters []string) ([]*vdevice, error) {
continue
}
if !strings.HasSuffix(name, flow.IOStatFileSuffix) {
continue
}
dev, err := newVDevice(dir, name)
if err != nil {
return nil, err