]> git.ipfire.org Git - thirdparty/util-linux.git/commit
blkdiscard: don't report "zero range" at the end
authorRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 9 Dec 2015 12:01:51 +0000 (13:01 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 9 Dec 2015 17:23:29 +0000 (18:23 +0100)
commiteeae448805c0eb2ef130a6ac301750706bb80420
tree1a17e848ab67eb98f960577b0ea5190748b4ea3e
parenta3e91e26467a0f644ee568bb0b3d481591834015
blkdiscard: don't report "zero range" at the end

We want to address the case that we have printed the last useful
stats line already within the loop. Avoiding an additional line
"Discarded 0 bytes ..." at the end.

Note there is a behavior change now for the edge cases "-v -l 0" and
"-v -o blksize" where we don't print any stats line anymore. But actually
it's correct, we never make any BLKDISCARD syscall with zero range.
Perhaps we should return error in these cases to help people who always
want to parse stats output on success.

CC: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
sys-utils/blkdiscard.c