File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,19 +149,20 @@ func (f *flistModule) cleanUnusedMounts() error {
149149 return nil
150150}
151151
152+ // forceUnmountAndRemove tries to fix the clean up of broken mounts by attempting to unmount them first
152153func (f * flistModule ) forceUnmountAndRemove (path string ) error {
153- // Try normal unmount first
154+ // try normal unmount first
154155 err := f .system .Unmount (path , 0 )
155156 if err != nil {
156157 log .Warn ().Err (err ).Msgf ("normal unmount failed for %s, trying lazy unmount" , path )
157158
158- // Try lazy unmount (MNT_DETACH)
159- err = syscall .Unmount (path , syscall .MNT_DETACH )
159+ // try lazy unmount
160+ err = f . system .Unmount (path , syscall .MNT_DETACH )
160161 if err != nil {
161162 return errors .Wrapf (err , "lazy unmount also failed for %s" , path )
162163 }
163164 }
164- // Now try to remove the directory
165+ // try to remove the path after unmount
165166 if err := os .RemoveAll (path ); err != nil {
166167 return errors .Wrapf (err , "failed to remove mountpoint %s" , path )
167168 }
You can’t perform that action at this time.
0 commit comments