Correctly store all bad sectors, not just first one on run.

This commit is contained in:
2017-06-08 21:47:18 +01:00
parent ea26320d65
commit 3395c01fda
6 changed files with 16 additions and 8 deletions

View File

@@ -241,7 +241,8 @@ namespace DiscImageChef.Core.Devices.Dumping
}
else
{
unreadableSectors.Add(i);
for(ulong b = i; b < i + blocksToRead; b++)
unreadableSectors.Add(b);
if(duration < 500)
mhddLog.Write(i, 65535);
else

View File

@@ -570,7 +570,8 @@ namespace DiscImageChef.Core.Devices.Dumping
// TODO: Record error on mapfile
errored += blocksToRead;
unreadableSectors.Add(i);
for(ulong b = i; b < i + blocksToRead; b++)
unreadableSectors.Add(b);
DicConsole.DebugWriteLine("Dump-Media", "READ error:\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
if(cmdDuration < 500)
mhddLog.Write(i, 65535);

View File

@@ -353,7 +353,8 @@ namespace DiscImageChef.Core.Devices.Dumping
// TODO: Record error on mapfile
errored += blocksToRead;
unreadableSectors.Add(i);
for(ulong b = i; b < i + blocksToRead; b++)
unreadableSectors.Add(b);
if(cmdDuration < 500)
mhddLog.Write(i, 65535);
else

View File

@@ -283,7 +283,8 @@ namespace DiscImageChef.Core.Devices.Dumping
// TODO: Record error on mapfile
errored += blocksToRead;
unreadableSectors.Add(i);
for(ulong b = i; b < i + blocksToRead; b++)
unreadableSectors.Add(b);
DicConsole.DebugWriteLine("Dump-Media", "READ error:\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
if(cmdDuration < 500)
mhddLog.Write(i, 65535);

View File

@@ -185,7 +185,8 @@ namespace DiscImageChef.Core.Devices.Scanning
else
{
results.errored += blocksToRead;
results.unreadableSectors.Add(i);
for(ulong b = i; b < i + blocksToRead; b++)
results.unreadableSectors.Add(b);
if(duration < 500)
mhddLog.Write(i, 65535);
else

View File

@@ -342,7 +342,8 @@ namespace DiscImageChef.Core.Devices.Scanning
(senseDecoded.Value.ASC != 0x64 || senseDecoded.Value.ASCQ != 0x00))
{
results.errored += blocksToRead;
results.unreadableSectors.Add(i);
for(ulong b = i; b < i + blocksToRead; b++)
results.unreadableSectors.Add(b);
if(cmdDuration < 500)
mhddLog.Write(i, 65535);
else
@@ -354,7 +355,8 @@ namespace DiscImageChef.Core.Devices.Scanning
else
{
results.errored += blocksToRead;
results.unreadableSectors.Add(i);
for(ulong b = i; b < i + blocksToRead; b++)
results.unreadableSectors.Add(b);
if(cmdDuration < 500)
mhddLog.Write(i, 65535);
else
@@ -429,7 +431,8 @@ namespace DiscImageChef.Core.Devices.Scanning
else
{
results.errored += blocksToRead;
results.unreadableSectors.Add(i);
for(ulong b = i; b < i + blocksToRead; b++)
results.unreadableSectors.Add(b);
if(cmdDuration < 500)
mhddLog.Write(i, 65535);
else