mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user