From c1edd55434eb2504307760b5c82d557286bb65bc Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 3 Oct 2008 22:43:17 +0000 Subject: Log creation of directory records and warn on conflicting records. --- bin/bbackupd/BackupClientDirectoryRecord.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/bbackupd/BackupClientDirectoryRecord.cpp b/bin/bbackupd/BackupClientDirectoryRecord.cpp index 201fae59..816459a0 100644 --- a/bin/bbackupd/BackupClientDirectoryRecord.cpp +++ b/bin/bbackupd/BackupClientDirectoryRecord.cpp @@ -1078,6 +1078,7 @@ bool BackupClientDirectoryRecord::UpdateItems( if(latestObjectID != 0) { // Use this one + BOX_TRACE("Storing uploaded file ID " << inodeNum << " (" << filename << " in ID map as object " << latestObjectID << " with parent " << mObjectID << " (" << rLocalPath << ")"); idMap.AddToMap(inodeNum, latestObjectID, mObjectID /* containing directory */); } else @@ -1089,12 +1090,19 @@ bool BackupClientDirectoryRecord::UpdateItems( if(currentIDMap.Lookup(inodeNum, objid, dirid)) { // Found + if (dirid != mObjectID) + { + BOX_WARNING("Found conflicting parent ID for file ID " << inodeNum << " (" << filename << "): expected " << mObjectID << " (" << rLocalPath << ") but found " << dirid << " (same directory used in two different locations?)"); + } + ASSERT(dirid == mObjectID); + // NOTE: If the above assert fails, an inode number has been reused by the OS, // or there is a problem somewhere. If this happened on a short test run, look // into it. However, in a long running process this may happen occasionally and // not indicate anything wrong. // Run the release version for real life use, where this check is not made. + BOX_TRACE("Storing found file ID " << inodeNum << " (" << filename << " in ID map as object " << latestObjectID << " with parent " << mObjectID << " (" << rLocalPath << ")"); idMap.AddToMap(inodeNum, objid, mObjectID /* containing directory */); } } -- cgit v1.2.3