mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Mount namespace can be nil after task exits
Updates #1035 PiperOrigin-RevId: 404017795
This commit is contained in:
committed by
gVisor bot
parent
4f6cda4d0e
commit
eafa3f19e4
@@ -950,7 +950,7 @@ func (l *Loader) executeAsync(args *control.ExecArgs) (kernel.ThreadID, error) {
|
||||
if kernel.VFS2Enabled {
|
||||
// task.MountNamespaceVFS2() does not take a ref, so we must do so ourselves.
|
||||
args.MountNamespaceVFS2 = tg.Leader().MountNamespaceVFS2()
|
||||
if !args.MountNamespaceVFS2.TryIncRef() {
|
||||
if args.MountNamespaceVFS2 == nil || !args.MountNamespaceVFS2.TryIncRef() {
|
||||
return 0, fmt.Errorf("container %q has stopped", args.ContainerID)
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1624,6 +1624,7 @@ func TestMultiContainerGoferKilled(t *testing.T) {
|
||||
defer cleanup()
|
||||
|
||||
conf := testutil.TestConfig(t)
|
||||
conf.VFS2 = true
|
||||
conf.RootDir = rootDir
|
||||
|
||||
sleep := []string{"sleep", "100"}
|
||||
|
||||
Reference in New Issue
Block a user