File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,10 +111,18 @@ func unmount(target string, flags int) error {
111111// UnmountAll repeatedly unmounts the given mount point until there
112112// are no mounts remaining (EINVAL is returned by mount), which is
113113// useful for undoing a stack of mounts on the same mount point.
114+ // UnmountAll all is noop when the first argument is an empty string.
115+ // This is done when the containerd client did not specify any rootfs
116+ // mounts (e.g. because the rootfs is managed outside containerd)
117+ // UnmountAll is noop when the mount path does not exist.
114118func UnmountAll (mount string , flags int ) error {
115- if _ , err := os . Stat ( mount ); err != nil {
119+ if mount == "" {
116120 return nil
117121 }
122+ if _ , err := os .Stat (mount ); os .IsNotExist (err ) {
123+ return nil
124+ }
125+
118126 for {
119127 if err := unmount (mount , flags ); err != nil {
120128 // EINVAL is returned if the target is not a
You can’t perform that action at this time.
0 commit comments