- Timestamp:
- Apr 8, 2010 9:39:01 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp
r28115 r28118 326 326 RTSGSEG Seg; 327 327 RTSGBUF SgBufCmp; 328 size_t cbOff = 0; 328 329 329 330 Seg.cbSeg = cbRange; … … 331 332 332 333 RTSgBufInit(&SgBufCmp, &Seg, 1); 333 if (RTSgBufCmp (&SgBuf, &SgBufCmp, cbRange))334 if (RTSgBufCmpEx(&SgBuf, &SgBufCmp, cbRange, &cbOff, true)) 334 335 { 335 unsigned offWrong = 0; 336 #if 0 337 for (offWrong = 0; offWrong < cbRange; offWrong++) 338 if (pbBuf[offWrong] != pSeg->pbSeg[offSeg + offWrong]) 339 #endif 340 { 341 /* Corrupted disk, print I/O log entry of the last write which accessed this range. */ 342 uint32_t cSector = (offSeg + offWrong) / 512; 343 AssertMsg(cSector < pSeg->cIoLogEntries, ("Internal bug!\n")); 344 345 RTMsgError("Corrupted disk at offset %llu (%u bytes in the current read buffer)!\n", 346 offCurr + offWrong, offWrong); 347 RTMsgError("Last write to this sector started at offset %llu with %u bytes (%u references to this log entry)\n", 348 pSeg->apIoLog[cSector]->off, 349 pSeg->apIoLog[cSector]->cbWrite, 350 pSeg->apIoLog[cSector]->cRefs); 351 RTAssertDebugBreak(); 352 } 336 /* Corrupted disk, print I/O log entry of the last write which accessed this range. */ 337 uint32_t cSector = (offSeg + cbOff) / 512; 338 AssertMsg(cSector < pSeg->cIoLogEntries, ("Internal bug!\n")); 339 340 RTMsgError("Corrupted disk at offset %llu (%u bytes in the current read buffer)!\n", 341 offCurr + cbOff, cbOff); 342 RTMsgError("Last write to this sector started at offset %llu with %u bytes (%u references to this log entry)\n", 343 pSeg->apIoLog[cSector]->off, 344 pSeg->apIoLog[cSector]->cbWrite, 345 pSeg->apIoLog[cSector]->cRefs); 346 RTAssertDebugBreak(); 353 347 } 354 348 } … … 356 350 offCurr += cbRange; 357 351 cbLeft -= cbRange; 358 RTSgBufAdvance(&SgBuf, cbRange);359 352 } 360 353
Note:
See TracChangeset
for help on using the changeset viewer.