]> sourceware.org Git - lvm2.git/commit
dmstats: fix interval number reporting with --count=0
authorBryn M. Reeves <bmr@redhat.com>
Sun, 18 Dec 2016 12:58:03 +0000 (12:58 +0000)
committerBryn M. Reeves <bmr@redhat.com>
Sun, 18 Dec 2016 13:03:45 +0000 (13:03 +0000)
commit5a4750d76c9930a6e4a181ab664f0cac4d1a400b
tree20fef4072759c42d5ddeffb42ae391cfefc12fd8
parent5635cd3b0337ac854a82a1a15cef2609c2091e6c
dmstats: fix interval number reporting with --count=0

When --count=0 interval numbers are miscalculated:

Interval     #18446744069414584325     time delta:    999920887ns
Interval     #18446744069414584325   current err:       -79113ns
End interval #18446744069414584325  duration:    999920887ns

This is because the command line argument is cast through the
uint32_t type, and fixed to UINT32_MAX:

  _count = ((uint32_t)_int_args[COUNT_ARG]) ? : UINT32_MAX;

We also need to handle --count=0 specially when calculating the
interval number: since intervals count from #1, this must account
for the implicit "minus one" when converting from zero to the
UINT64_MAX value used (which is too large to store in _int_args).
tools/dmsetup.c
This page took 0.029383 seconds and 5 git commands to generate.