mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(fsck): fix nil pointer when get partition info
close:#22709584 Signed-off-by: true1064 <tangjingyu@oppo.com>
This commit is contained in:
parent
d09a0d21e4
commit
17b4921396
@ -516,17 +516,19 @@ func getExtentsByMpId(dir string, volname string, mpId string) {
|
||||
}
|
||||
|
||||
// handle migrate extents
|
||||
sme := ino.HybridCouldExtentsMigration.GetSortedEks()
|
||||
if sme != nil {
|
||||
if proto.IsStorageClassReplica(ino.HybridCouldExtentsMigration.GetStorageClass()) {
|
||||
replicaMigrateExtents := sme.(*metanode.SortedExtents)
|
||||
walkBuf = normalMigrateBuf
|
||||
replicaMigrateExtents.Range(walkFunc)
|
||||
if ino.HybridCouldExtentsMigration != nil {
|
||||
sme := ino.HybridCouldExtentsMigration.GetSortedEks()
|
||||
if sme != nil {
|
||||
if proto.IsStorageClassReplica(ino.HybridCouldExtentsMigration.GetStorageClass()) {
|
||||
replicaMigrateExtents := sme.(*metanode.SortedExtents)
|
||||
walkBuf = normalMigrateBuf
|
||||
replicaMigrateExtents.Range(walkFunc)
|
||||
}
|
||||
// TODO: handle other impl type of HybridCouldExtentsMigration
|
||||
} else {
|
||||
log.LogDebugf("HybridCouldExtentsMigration is nil, mpId(%v) inode(%v) host(%v) storageClass(%v)",
|
||||
mpId, ino.Inode, addr, proto.StorageClassString(ino.HybridCouldExtentsMigration.GetStorageClass()))
|
||||
}
|
||||
// TODO: handle other impl type of HybridCouldExtentsMigration
|
||||
} else {
|
||||
log.LogDebugf("HybridCouldExtentsMigration is nil, mpId(%v) inode(%v) host(%v) storageClass(%v)",
|
||||
mpId, ino.Inode, addr, proto.StorageClassString(ino.HybridCouldExtentsMigration.GetStorageClass()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,7 +215,8 @@ func getDataPartitions(addr, name string) ([]*proto.DataPartitionResponse, error
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decompress data partitions failed: %+v", err)
|
||||
}
|
||||
var dpv *proto.DataPartitionsView
|
||||
|
||||
dpv := &proto.DataPartitionsView{}
|
||||
if err = proto.UnmarshalHTTPReply(data, dpv); err != nil {
|
||||
return nil, fmt.Errorf("Unmarshal data partitions view failed: %v", err)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user