If by any chance the punch size is >= the interval, we end up punching
everything, zeroing out the file.
As this is not a tool to dealloc the whole file, so force the user to
pass a configuration that won't cause it to happen.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
usage(argv[0]);
}
+ if (size >= interval) {
+ printf("Interval must be > size\n");
+ usage(argv[0]);
+ }
+
if (optind != argc - 1)
usage(argv[0]);