badblocks: fix operation with large block sizes and/or counts
Hi,
This PR fixes some issues I found when attempting to do a non-destructive read/write test on a hard drive. The default settings result in frequent seeking and overall low throughput, so my goal was to minimize seeking. Subject to memory constraints, reading/writing 2 GB at a time seemed reasonable, but I was unable to do so until making some changes.
Details are listed in each commit message.
Thanks, Corey
@tytso is this PR acceptable? Please let me know if there is a procedure I need to follow; I wasn't able to find any guidelines beyond the SUBMITTING-PATCHES file in the repo.
Applied, thanks.
Applied, thanks.
Thank you.
-Corey