]> git.ipfire.org Git - thirdparty/util-linux.git/commit - disk-utils/mkswap.c
mkswap: unbreak -c ("check") option.
authorPeter De Wachter <pdewacht@gmail.com>
Sat, 5 Sep 2009 19:19:56 +0000 (21:19 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 7 Sep 2009 06:49:19 +0000 (08:49 +0200)
commitadda7f7ecd53eef1074d8ea531b635c322507a7f
tree835c85c3b10d3fb20ad556be47930f10ddcf4771
parent3096d61a916feffff300b9e1ce8ca57f7fdbf2bc
mkswap: unbreak -c ("check") option.

In the check_blocks() loop, current_page is not incremented. Because of this
bug, the loop does not end when the end of the device is reached.  Instead it
tries to continue reading, which of course fails, and eventually mkswap aborts
("too many bad pages").

Note that this can only be tested with swap partitions, mkswap ignores the -c
option for swap files.

Signed-off-by: Peter De Wachter <pdewacht@gmail.com>
disk-utils/mkswap.c