fs: Don't bother saving negative dirents.

PiperOrigin-RevId: 210616454
Change-Id: I3f536e2b4d603e540cdd9a67c61b8ec3351f4ac3
This commit is contained in:
Nicolas Lacasse 2018-08-28 15:17:32 -07:00 committed by Shentubot
parent 515d9bf43b
commit 3b11769c77
1 changed files with 7 additions and 1 deletions

View File

@ -45,7 +45,13 @@ func (d *Dirent) saveChildren() map[string]*Dirent {
if rc := w.Get(); rc != nil {
// Drop the reference count obtain in w.Get()
rc.DecRef()
c[name] = rc.(*Dirent)
cd := rc.(*Dirent)
if cd.IsNegative() {
// Don't bother saving negative Dirents.
continue
}
c[name] = cd
}
}
return c