Details
Description
In FSEditLog.removeEditsForStorageDir, we iterate over the edits streams trying to find the stream corresponding to a given dir. To check equality, we currently use the following condition:
File parentDir = getStorageDirForStream(idx);
if (parentDir.getName().equals(sd.getRoot().getName())) {
... which is horribly incorrect. If two or more storage dirs happen to have the same terminal path component (eg /data/1/nn and /data/2/nn) then it will pick the wrong stream(s) to remove.