fsimpl/gofer: implement specialFileFD.InvalidateUnsavable()

This fixes save/restore of mmapped gofer.specialFileFDs (usually obtained via
mount option "disable_file_handle_sharing") for which mappings have actually
been used (mm.pmas have been obtained).

PiperOrigin-RevId: 700465816
This commit is contained in:
Jamie Liu
2024-11-26 14:46:38 -08:00
committed by gVisor bot
parent e1cb1a70b4
commit 64e48cc3c6
+4
View File
@@ -482,6 +482,10 @@ func (fd *specialFileFD) Translate(ctx context.Context, required, optional memma
// InvalidateUnsavable implements memmap.Mappable.InvalidateUnsavable.
func (fd *specialFileFD) InvalidateUnsavable(ctx context.Context) error {
d := fd.dentry()
d.mapsMu.Lock()
defer d.mapsMu.Unlock()
d.mappings.InvalidateAll(memmap.InvalidateOpts{})
return nil
}