Commit 03375523 authored by Vitaly Lipatov's avatar Vitaly Lipatov

force rewrite when SG_IO: bad sense error

parent 7ca01f96
......@@ -34,9 +34,21 @@ fix_block()
{
local DEV=$1
local block=$2
local force="$FORCE"
# FIXME: possible badblocks always returns true
# badblocks -b 512 -v -s $DEV $block $block && { echo "Already OK, skipped..." ; [ -z "$FORCE" ] && return ; }
test_block $DEV $block && { echo "Already OK, skipped..." ; [ -z "$FORCE" ] && return ; }
if test_block $DEV $block >/tmp/test_block.out 2>&1 ; then
if grep "SG_IO: bad/missing sense data" /tmp/test_block.out ; then
force=1
fi
if [ -n "$force" ] ; then
echo "Force rewrite ..."
else
echo "Already OK, skipped ..."
return
fi
fi
if [ -z "$TESTONLY" ] ; then
echo "Test only"
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment