@@ -273,7 +273,7 @@ func mountExpFS(ctx context.Context, layerFDs []int, submounts []string) (*fs.In
273
273
var currentNode * fs.Inode
274
274
275
275
if submounts != nil {
276
- msrc := fs .NewPseudoMountSource ()
276
+ msrc := fs .NewPseudoMountSource (ctx )
277
277
mountTree , err := ramfs .MakeDirectoryTree (ctx , msrc , submounts )
278
278
if err != nil {
279
279
return nil , fmt .Errorf ("creating mount tree: %v" , err )
@@ -305,7 +305,7 @@ func mountExpFS(ctx context.Context, layerFDs []int, submounts []string) (*fs.In
305
305
306
306
// subtargets takes a set of Mounts and returns only the targets that are
307
307
// children of the given root. The returned paths are relative to the root.
308
- func subtargets (root string , mnts []specs.Mount , layerFDs [] int ) []string {
308
+ func subtargets (root string , mnts []specs.Mount ) []string {
309
309
var targets []string
310
310
for _ , mnt := range mnts {
311
311
if relPath , isSubpath := fs .IsSubpath (mnt .Destination , root ); isSubpath {
@@ -315,8 +315,8 @@ func subtargets(root string, mnts []specs.Mount, layerFDs []int) []string {
315
315
return targets
316
316
}
317
317
318
- func setupContainerFS (ctx context.Context , conf * Config , mntr * containerMounter , procArgs * kernel.CreateProcessArgs ) error {
319
- mns , err := mntr .setupFS (conf , procArgs )
318
+ func setupContainerFS (ctx context.Context , conf * Config , mntr * containerMounter , procArgs * kernel.CreateProcessArgs , layerFDs [] int ) error {
319
+ mns , err := mntr .setupFS (conf , procArgs , layerFDs )
320
320
if err != nil {
321
321
return err
322
322
}
@@ -618,7 +618,7 @@ func (c *containerMounter) processHints(conf *Config) error {
618
618
// setupFS is used to set up the file system for all containers. This is the
619
619
// main entry point method, with most of the other being internal only. It
620
620
// returns the mount namespace that is created for the container.
621
- func (c * containerMounter ) setupFS (conf * Config , procArgs * kernel.CreateProcessArgs ) (* fs.MountNamespace , error ) {
621
+ func (c * containerMounter ) setupFS (conf * Config , procArgs * kernel.CreateProcessArgs , layerFDs [] int ) (* fs.MountNamespace , error ) {
622
622
log .Infof ("Configuring container's file system" )
623
623
624
624
// Create context with root credentials to mount the filesystem (the current
@@ -630,7 +630,7 @@ func (c *containerMounter) setupFS(conf *Config, procArgs *kernel.CreateProcessA
630
630
rootProcArgs .MaxSymlinkTraversals = linux .MaxSymlinkTraversals
631
631
rootCtx := rootProcArgs .NewContext (c .k )
632
632
633
- mns , err := c .createMountNamespace (rootCtx , conf )
633
+ mns , err := c .createMountNamespace (rootCtx , conf , layerFDs )
634
634
if err != nil {
635
635
return nil , err
636
636
}
@@ -644,8 +644,8 @@ func (c *containerMounter) setupFS(conf *Config, procArgs *kernel.CreateProcessA
644
644
return mns , nil
645
645
}
646
646
647
- func (c * containerMounter ) createMountNamespace (ctx context.Context , conf * Config ) (* fs.MountNamespace , error ) {
648
- rootInode , err := c .createRootMount (ctx , conf )
647
+ func (c * containerMounter ) createMountNamespace (ctx context.Context , conf * Config , layerFDs [] int ) (* fs.MountNamespace , error ) {
648
+ rootInode , err := c .createRootMount (ctx , conf , layerFDs )
649
649
if err != nil {
650
650
return nil , fmt .Errorf ("creating filesystem for container: %v" , err )
651
651
}
@@ -656,7 +656,7 @@ func (c *containerMounter) createMountNamespace(ctx context.Context, conf *Confi
656
656
return mns , nil
657
657
}
658
658
659
- func (c * containerMounter ) mountSubmounts (ctx context.Context , conf * Config , mns * fs.MountNamespace , layerFDs [] int ) error {
659
+ func (c * containerMounter ) mountSubmounts (ctx context.Context , conf * Config , mns * fs.MountNamespace ) error {
660
660
root := mns .Root ()
661
661
defer root .DecRef ()
662
662
@@ -667,7 +667,7 @@ func (c *containerMounter) mountSubmounts(ctx context.Context, conf *Config, mns
667
667
return fmt .Errorf ("mount shared mount %q to %q: %v" , hint .name , m .Destination , err )
668
668
}
669
669
} else {
670
- _ , dirent , err_submount := mountSubmount (ctx , conf , mns , root , fds , m , mounts );
670
+ _ , dirent , err_submount := c . mountSubmount (ctx , conf , mns , root , m );
671
671
if dirent != nil {
672
672
dirent .DecRef ()
673
673
}
@@ -740,17 +740,22 @@ func (c *containerMounter) createRootMount(ctx context.Context, conf *Config, la
740
740
// First construct the filesystem from the spec.Root.
741
741
mf := fs.MountSourceFlags {ReadOnly : c .root .Readonly || conf .Overlay }
742
742
743
- if conf .OverlayfsStaleRead {
743
+ // if conf.OverlayfsStaleRead {
744
744
// We can't check for overlayfs here because sandbox is chroot'ed and gofer
745
745
// can only send mount options for specs.Mounts (specs.Root is missing
746
746
// Options field). So assume root is always on top of overlayfs.
747
- opts = append (opts , "overlayfs_stale_read" )
748
- }
747
+ // opts = append(opts, "overlayfs_stale_read")
748
+ // }
749
749
750
- rootInode , err := p9FS .Mount (ctx , rootDevice , mf , strings .Join (opts , "," ), nil )
751
- if err != nil {
752
- return nil , fmt .Errorf ("creating root mount point: %v" , err )
753
- }
750
+ var (
751
+ rootInode * fs.Inode
752
+ err error
753
+ )
754
+
755
+ //rootInode, err := p9FS.Mount(ctx, rootDevice, mf, strings.Join(opts, ","), nil)
756
+ //if err != nil {
757
+ // return nil, fmt.Errorf("creating root mount point: %v", err)
758
+ //}
754
759
755
760
// We need to overlay the root on top of a ramfs with stub directories
756
761
// for submount paths. "/dev" "/sys" "/proc" and "/tmp" are always
0 commit comments