@@ -732,7 +732,7 @@ func (d *lvm) thinPoolVolumeUsage(volDevPath string) (uint64, uint64, error) {
732
732
"--units" , "b" ,
733
733
"--nosuffix" ,
734
734
"--separator" , "," ,
735
- "-o" , "lv_size,data_percent,metadata_percent " ,
735
+ "-o" , "lv_size,data_percent" ,
736
736
}
737
737
738
738
out , err := subprocess .RunCommand ("lvs" , args ... )
@@ -741,7 +741,7 @@ func (d *lvm) thinPoolVolumeUsage(volDevPath string) (uint64, uint64, error) {
741
741
}
742
742
743
743
parts := util .SplitNTrimSpace (out , "," , - 1 , true )
744
- if len (parts ) < 3 {
744
+ if len (parts ) < 2 {
745
745
return 0 , 0 , fmt .Errorf ("Unexpected output from lvs command" )
746
746
}
747
747
@@ -762,17 +762,7 @@ func (d *lvm) thinPoolVolumeUsage(volDevPath string) (uint64, uint64, error) {
762
762
return 0 , 0 , fmt .Errorf ("Failed parsing thin volume used percentage (%q): %w" , parts [1 ], err )
763
763
}
764
764
765
- metaPerc := float64 (0 )
766
-
767
- // For thin volumes there is no meta data percentage. This is only for the thin pool volume itself.
768
- if parts [2 ] != "" {
769
- metaPerc , err = strconv .ParseFloat (parts [2 ], 64 )
770
- if err != nil {
771
- return 0 , 0 , fmt .Errorf ("Failed parsing thin pool meta used percentage (%q): %w" , parts [2 ], err )
772
- }
773
- }
774
-
775
- usedSize := uint64 (float64 (total ) * ((dataPerc + metaPerc ) / 100 ))
765
+ usedSize := uint64 (float64 (total ) * (dataPerc / 100 ))
776
766
777
767
return totalSize , usedSize , nil
778
768
}
0 commit comments