overlay: check if we're about to save an empty path

Summary:
On Windows, we've had a couple of cases where the overlay is corrupted which
prevent remounting EdenFS. In this case, one entry of a directory was an empty
path. Let's try to catch the error when it happens, instead of after the fact.

Reviewed By: wez

Differential Revision: D21443002

fbshipit-source-id: 47e59aee803cc0b4befd6e0585836d5c68e905b1
This commit is contained in:
Xavier Deguillard 2020-05-07 17:54:36 -07:00 committed by Facebook GitHub Bot
parent 13a8f17325
commit 97814429bc

View File

@ -249,6 +249,9 @@ void Overlay::saveOverlayDir(InodeNumber inodeNumber, const DirContents& dir) {
const auto& entName = entIter.first;
const auto& ent = entIter.second;
CHECK_NE(entName, "")
<< "saveOverlayDir called with entry with an empty path for directory with inodeNumber="
<< inodeNumber;
CHECK_LT(ent.getInodeNumber().get(), nextInodeNumber)
<< "saveOverlayDir called with entry using unallocated inode number";