mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Take a reference on the already-mounted inode before re-mounting it.
PiperOrigin-RevId: 257855777
This commit is contained in:
committed by
gVisor bot
parent
eff2c264a4
commit
8f11e257c9
@@ -906,7 +906,10 @@ func (c *containerMounter) mountSharedSubmount(ctx context.Context, mns *fs.Moun
|
||||
}
|
||||
defer target.DecRef()
|
||||
|
||||
// Take a ref on the inode that is about to be (re)-mounted.
|
||||
source.root.IncRef()
|
||||
if err := mns.Mount(ctx, target, source.root); err != nil {
|
||||
source.root.DecRef()
|
||||
return fmt.Errorf("bind mount %q error: %v", mount.Destination, err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user