Don't drop the mountpoint reference in already umounted dead mountpoints.

PiperOrigin-RevId: 599952931
This commit is contained in:
Lucas Manning
2024-01-19 15:29:05 -08:00
committed by gVisor bot
parent 63f4364e59
commit 7b151e25d0
+3 -1
View File
@@ -338,9 +338,11 @@ func (vfs *VirtualFilesystem) forgetDeadMountpoint(ctx context.Context, d *Dentr
vfs.lockMounts()
defer vfs.unlockMounts(ctx)
for mnt := range vfs.mountpoints[d] {
// If umounted is true, the mount point has already been decrefed by umount
// so we don't need to release the reference again here.
if mnt.umounted {
vfs.mounts.seq.BeginWrite()
vfs.delayDecRef(vfs.disconnectLocked(mnt))
vfs.disconnectLocked(mnt)
vfs.delayDecRef(mnt)
vfs.mounts.seq.EndWrite()
} else {