Whamcloud - gitweb
badblocks: Limit maximum number of bad blocks
authorJan Kara <jack@suse.cz>
Mon, 15 Dec 2014 01:55:44 +0000 (20:55 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 15 Dec 2014 01:55:44 +0000 (20:55 -0500)
commitfcc19b4aa36c499a6574668c9346176628e29ddd
tree5ba6e9bdd8397d52a65d72b8256ca7e87daddf79
parent0462fd6db55de28d7e087d8d06ab20339acd8f67
badblocks: Limit maximum number of bad blocks

Currently maximum number of bad blocks is not limited in any way.
However our code can really handle at most INT_MAX/2 bad blocks (for
larger numbers binary search indexes start overflowing). So report
number of bad blocks is just too big instead of plain segfaulting.

It won't be too hard to raise the limit but I don't think there's any
real use for disks with over 1 billion of bad blocks...

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/badblocks.c