Whamcloud - gitweb
badblocks: add a max bad blocks count option
authorIustin Pop <iustin@google.com>
Wed, 11 Jun 2008 11:12:17 +0000 (13:12 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 17 Jun 2008 11:33:29 +0000 (07:33 -0400)
commit931b0289eee5d83bff7e80c7420bda0a5bb078da
treea00fcae7952c17620d6240d3c2498f840595d480
parenta8d632a4e9fd528631d2ce8c28b4aade8da0a862
badblocks: add a max bad blocks count option

Currently, badblocks will continue scanning the device until it reaches
last_block, even though it might be that the drive is not responding
at all anymore.

This patch introduces a new parameter ('-e') that allows one to specify
the maximum bad block count; if badblocks sees more than this number, it
will abort the test.

While this is not useful for testing a device that will need to be used
as a filesystem (because we don't get an exhaustive list of bad blocks),
it is useful for testing if a device has bad blocks at all: for example,
with a count of 1, it will finish after the first error thus not needing
to test the whole device if the only purpose of the test is to check for
any bad blocks.

Signed-off-by: Iustin Pop <iustin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/badblocks.8.in
misc/badblocks.c