diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-10-03 22:43:17 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-10-03 22:43:17 +0000 |
commit | c1edd55434eb2504307760b5c82d557286bb65bc (patch) | |
tree | 8d25cdc4d159c614ea66a5b305959cd74ace1bca /bin | |
parent | de04ad0decc0d98e455e9f6a7f1ec5ab9a6621ca (diff) |
Log creation of directory records and warn on conflicting records.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/bbackupd/BackupClientDirectoryRecord.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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 */); } } |