|
|
@ -180,12 +180,12 @@ func (d *Disk) doAddOrUpdateVolume(v storage.VolumeInfo) (isNew, isChanged bool) |
|
|
// Adjust active volume count when ReadOnly status changes
|
|
|
// Adjust active volume count when ReadOnly status changes
|
|
|
// Use a separate delta object to avoid affecting other metric adjustments
|
|
|
// Use a separate delta object to avoid affecting other metric adjustments
|
|
|
readOnlyDelta := &DiskUsageCounts{} |
|
|
readOnlyDelta := &DiskUsageCounts{} |
|
|
if !v.ReadOnly && oldV.ReadOnly { |
|
|
|
|
|
// Changed from read-only to writable
|
|
|
|
|
|
readOnlyDelta.activeVolumeCount = 1 |
|
|
|
|
|
} else if v.ReadOnly && !oldV.ReadOnly { |
|
|
|
|
|
|
|
|
if v.ReadOnly { |
|
|
// Changed from writable to read-only
|
|
|
// Changed from writable to read-only
|
|
|
readOnlyDelta.activeVolumeCount = -1 |
|
|
readOnlyDelta.activeVolumeCount = -1 |
|
|
|
|
|
} else { |
|
|
|
|
|
// Changed from read-only to writable
|
|
|
|
|
|
readOnlyDelta.activeVolumeCount = 1 |
|
|
} |
|
|
} |
|
|
d.UpAdjustDiskUsageDelta(types.ToDiskType(v.DiskType), readOnlyDelta) |
|
|
d.UpAdjustDiskUsageDelta(types.ToDiskType(v.DiskType), readOnlyDelta) |
|
|
} |
|
|
} |
|
|
|